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

Ask Your Question
0

Unified view of localspaces

Hi,

I need some clarificatin regarding the unified access over space.

I want to load the data from two different external data sources into the space using EDS APIs. Hence I wrote two PUs, where each PU loads the data from a data source. Among two PUs, one PU is based on DefaultHibernate and another PU is based on my own implementation.

Now I want to load the data from both datasources to a common space so that an application can access these loaded data from the common space.

Gigaspace restricts me to use only embedded space if I have to implement EDS, hence I landed in a situation where I have two embedded space. However I want my external application to have a common space, or share these space using a common view or URL.

How can I achieve this?

Thanks Seshadri h4. Attachments

[pu2.xml|/upfiles/13759705963865857.xml]

[pu1.xml|/upfiles/13759705969858058.xml]

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

asked 2010-04-30 06:41:34 -0600

seshadrite gravatar image

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

jaissefsfex gravatar image
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

Can't you unify these 2 by extending the default HEDS? This will make sure both of them will be called once the space will be started.

Another option is to load the data using regular external remote client.In this case you might want to mark the loaded objects as non persistent (transient) to avoid having these sent back to the EDS. You might want also consider in this case running the EDS in read only mode.

Shay

Attachments

  1. pu2.xml
  2. pu1.xml

answered 2010-04-30 07:05:13 -0600

shay hassidim gravatar image
edit flag offensive delete link more

Comments

Hi,

I cant use HEDS for both the case, as one of the datasource is not based on DBMS. HEDS provides ORM mapping only for DBMS type of data source, not for other type of data sources.

Hence I was writing my own implementation of EDS to load the data. I was able to load the data successfully to space, but its getting loaded into the embedded space of the PU that I designed. Hence it looks like two embedded space, controlled by two PUs which implement their own EDS implementation.

The reason why I want both of them as EDS, as I need to provide persistency support for both the data sources. This is not possible for the solution you proposed.

Please refer the PU files attached for modelling these EDSes.

Thanks Seshadri h4. Attachments

[pu2.xml|/upfiles/13759705975694109.xml]

[pu1.xml|/upfiles/13759705975949409.xml]

seshadrite gravatar imageseshadrite ( 2010-04-30 07:19:19 -0600 )edit

First of all - You should take out the :
  <prop key="gigaspace.hibernate.cache.url">/./xxxspace</prop>
from the hibernateProperties. It is not being used.

To answer your question:
1. Your org.openspaces.example.sdm.ldap.LDAPProcessor should extend the org.openspaces.persistency.hibernate.DefaultHibernateExternalDataSource.
2. The LDAPProcessor initialLoad should call the DefaultHibernateExternalDataSource initialLoad method (super) , get the generated DataIterator and add into it the list created by the LDAPProcessor.

This how the space will be initialized once started with both Hibernate based objects and your LDAP objects. You don't need two pu.xml with this approach.

Would that work for you?

Shay

shay hassidim gravatar imageshay hassidim ( 2010-04-30 09:34:18 -0600 )edit

Hi,

Thanks for your response.

Sounds promising. I will try it out and let you know on Monday.

Thanks
Seshadri

seshadrite gravatar imageseshadrite ( 2010-04-30 10:07:47 -0600 )edit

Hi,

Tried the solution that you have shared. I extended DefaultHibernateExternalDataSource in my LDAPProcessor. Its giving me Null pointer exception, when I call super.initialLoad() method.

However when I gave the the DefaultHibernateExternalDataSource directly instead of LDAPProcessor, I face no issues at all.

Thanks Seshadri

java.lang.NullPointerException at org.openspaces.persistency.hibernate.DefaultHibernateExternalDataSource.initialLoad(DefaultHibernateExternalDataSource.java:147) at org.openspaces.example.sdm.ldap.LDAPProcessor.initialLoad(LDAPProcessor.java:50) at com.gigaspaces.datasource.concurrentaccess.SharedIteratorSQLDataProviderDecorator.initialLoad(SharedIteratorSQLDataProviderDecorator.java:85) at com.j_spaces.sadapter.datasource.DataStorage.initialLoad(DataStorage.java:468) at com.j_spaces.sadapter.datasource.DataAdapter.makeEntriesIter(DataAdapter.java:901) at com.j_spaces.core.cache.CacheManager.initCache(CacheManager.java:702) at com.gigaspaces.internal.server.space.SpaceEngine.initCache(SpaceEngine.java:860) at com.gigaspaces.internal.server.space.SpaceEngine.init(SpaceEngine.java:721) at com.gigaspaces.internal.server.space.SpaceImpl.initAndRecoverFromDataStorage(SpaceImpl.java:3319) at com.gigaspaces.internal.server.space.SpaceImpl.initAndStartRegularSpace(SpaceImpl.java:3204) at com.gigaspaces.internal.server.space.SpaceImpl.start(SpaceImpl.java:2994)

seshadrite gravatar imageseshadrite ( 2010-05-12 08:28:08 -0600 )edit

How your initial load looks like?

shay hassidim gravatar imageshay hassidim ( 2010-05-12 08:35:13 -0600 )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

Stats

Asked: 2010-04-30 06:41:34 -0600

Seen: 23 times

Last updated: Apr 30 '10