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

Ask Your Question

Problems implementing ExternalDataSource


We're trying to implement the read/write-through capabilities of the space to gain some persistence. We've tried the Gigaspaces built in persistence, but the obfuscation of the data meant that users who wanted to read the database directly couldn't. So our solution was to use the read/write-through functionality to achieve pretty much the same thing (but with greater control on our side).

However, we ran into a small problem when looking into this, namely the way we enter objects into our space. Currently we have a TradeEventEntry object that contains a Serializable tradeRepresentation. This is the object we're interested in adding to the DB, not the TradeEventEntry object (which basically acts as an envelope and has no business logic inside). However, the HibernateDataSource object which we were using for the write through functionality only picks up the TradeEventEntry object and submits this into the database. As such, the Serializable object is placed inside the table as a varbinary type and cannot be queried on.

Therefore, we decided to construct our own ExternalDataSource which runs along similar lines to the HibernateDataSource, but strips out the Serializable object and transforms it into a PersistentFuture object, which is then used to save to the DB through Hibernate. However, when we completed this and ran it up it became apparent that Gigaspaces was providing us with empty TradeEventEntry objects. Although they're not null, they contain none of the properties that were created when stored in the space. Only the UID is viewable in the object through the __getEntryInfo() method. Our Serializable tradeRepresentation is null and cannot be processed.

Our code runs in a similar way to the HibernateDataSource, we just decontruct the TradeEventEntry object when placing the Serializable object in the DB and then reconstruct it when reading from the DB.

Does anyone have an idea as to why Gigaspaces is pushing empty objects to methods in my implementation of ExternalDataSource?

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

asked 2008-05-08 08:44:17 -0500

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

jaissefsfex gravatar image
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

Hello Mike,

You're going the right path. The External Data Source was designed for custom integrations with external information sources. Is there a specific reason you're working with Entry interface? Just for convenience you can use simple pojo's as your entries.

Currently there is a limitation (which is about to be fixed in 6.5), where even in Entries you should implement getter/setter methods while using EDS - so for this reason (and many others) I would recommend working with pojo.

Cheers, Guy

answered 2008-05-08 15:44:21 -0500

nirpaz gravatar image
edit flag offensive delete link more


Unfortunately I'm working with an architecture that is built around Gigaspaces and cannot be changed. Unfortunately the choice of using Entry isn't one I advocated or have the ability to change.

Do you have an idea as to why I am getting incomplete objects?

gingaaaml gravatar imagegingaaaml ( 2008-05-09 06:21:04 -0500 )edit

When using the External Data Source interface you must have getter/setter for all Class (Entry/POJO) fields.
Do you have such for the tradeRepresentation field?


shay hassidim gravatar imageshay hassidim ( 2008-05-12 23:25:16 -0500 )edit

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: 2008-05-08 08:44:17 -0500

Seen: 29 times

Last updated: May 08 '08