Welcome to the new Gigaspaces XAP forum. To recover your account, please follow these instructions.

Ask Your Question

Advanced Example: JdbcDataSource

Reference: .../Advanced/Data_Grid/Database-Integration/JdbcDataSource

I am interested in applying the Space API.

  1. As far as I can determine, the class JdbcDataSource is not deployed within the <gigaspaces root="">, because it is not populating HSQLDB server mydb when calling startAllSpaceAPI.sh.

Should I deploy class JdbcDataSource using GigaSpaces Management Center (gs-ui.sh) through Open Spaces - Processing Unit?

If so, then I presume that I need to implement a pu.xml file?

  1. Where do I place the config files ../Advanced/Data_Grid/Database-Integration/JdbcDataSource/config/* with <gigaspace root="">? Specifically: jdbc_datasource.properties, jdbcspace.properties, and mapping/Person.gs.xml.

  2. The script for starting a HSQLDB server is as follows: {quote}java -cp ../lib/jdbc/hsqldb.jar org.hsqldb.Server -database mydb -port 9003{quote} Where is it declared that the database URL for this example is mydb, which will be used by component JdbcDataSource? I see within jdbc_datasource.properties that url=jdbc:hsqldb:hsql://localhost:9003

  3. Within readme: {quote}To run the example using CacheLoader implementation for the Space API...{quote} Where is the interface com.j_spaces.javax.cache.CacheLoader used in this example?

  4. When compiling JdbcDataSource.java, I am getting compiler warnings about references to generic types should be parameterized. The warning pertains to:

    public class JdbcDataSource implements ExternalDataSource<t> public class ResultSetIterator implements DataIterator<t>

Should <t> be Person?

  1. Continuing on the same thread of the previous question, for a class that implements ExternalDataSource<t>, should each its implementation be different for each type <t>? For example, what if HSQLDB server mydb holds more than just +Person+ table; let's say it also holds +Address+ table. Then would I need to implement a new ExternalDataSource<t> to initialize and configure the data source AND iterator over all the entries that should be loaded into space?

  2. Application DataSourceSpaceApi, when it is performing changes upon the space (using IJSpace.write(), IJSpace.take(), and IJSpace.update()), is it also changing the backend database *mydb?

I am presuming the IJSpace.read() is only reading the space and not reading from the backend database *mydb, correct?


{quote}This thread was imported from the previous forum. For your reference, the original is [available here|http://forum.openspaces.org/thread.jspa?threadID=2105]{quote}

asked 2007-07-30 20:58:05 -0500

jeff_seattle gravatar image

updated 2013-08-08 09:52:00 -0500

jaissefsfex gravatar image
edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

To declare external data source via the open spaces API see:

To control the operations that will be delegated to the database - see:


To delegate read operations to the database , make sure you run the space using LRU cache policy (0).

Please ignore the com.j_spaces.javax.cache.CacheLoader. It is a mistake within the readme.

You should use the interfaces from the com.gigaspaces.datasource package.


answered 2007-08-02 03:29:05 -0500

shay hassidim gravatar image
edit flag offensive delete link more
  1. In continuing the thread of Question 7, is there a way where class JdbcDataSource loads the space from the populated backend database mydb upon startup, but the application DataSourceSpaceApi does not migrate updates within the space to the backend database?

answered 2007-07-30 21:04:02 -0500

jeff_seattle gravatar image
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2007-07-30 20:58:05 -0500

Seen: 66 times

Last updated: Jul 30 '07