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

Ask Your Question

Question about GigaSpaces Persistency behavior with Mirror Service


We want to set up a LRU Space and mirror service with external datasource (database).

The LRU Space is configured with the following pu.xml segment.

<bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close">
    <property name="jdbcUrl" value="jdbc:mysql://${databaseServer}/${database}" />

<bean id="sessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
    <property name="dataSource" ref="dataSource"/>

<bean id="hibernateDataSource" class="org.openspaces.persistency.hibernate.StatelessHibernateExternalDataSource">
    <property name="sessionFactory" ref="sessionFactory"/>

<os-core:space id="mySpace" url="/./mySpace" schema="persistent" mirror="true" external-data-source="hibernateDataSource">
        <prop key="space-config.engine.cache_policy">0</prop>
        <prop key="space-config.external-data-source.usage">read-write</prop>

We would like to understand more about the datasource persistency behavior.

If LRU Space and mirror service are configured with two different databases, then both LRU Space and mirror will persist data separately into two databases. Is it correct?

If LRU Space and mirror service are configured with same database, then what will happen? Data will be persisted into same database from LRU Space and mirror service. (duplicated insertion?) What is the behavior of this setting?

Thanks, Yan.

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

asked 2010-06-09 11:53:01 -0600

yanchan gravatar image

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

jaissefsfex gravatar image
edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

Interesting. Why you would like to have the space and mirror writing into different databases?

The mirror has been designed to work with a space that is configured to have:

<prop key="space-config.external-data-source.usage">read-only</prop>


answered 2010-06-09 12:25:27 -0600

shay hassidim gravatar image
edit flag offensive delete link more

Hi Shay,

Thanks for your reply.

We just want to know the situation if the Space is configured with: <prop key="space-config.external-data-source.usage">read-write</prop>

then Space and mirror will persist data into same database.
So that duplicated database insertion will be occurred. Is it right?

This is not a practical case. It is just for testing.

Regards, Yan.

answered 2010-06-10 02:09:08 -0600

yanchan 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: 2010-06-09 11:53:01 -0600

Seen: 129 times

Last updated: Jun 10 '10