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

Ask Your Question
0

com.j_spaces.core.client.CacheTimeoutException

Hi

We are implementing Gigaspaces XAP for Hibernate 2nd level cache (transactional cache) and we are experiencing the following exception when 2 concurrent users access a page for the first time or some other funcationality:

code
Caused by: com.j_spaces.core.client.CacheTimeoutException: Entry 12125296125CacheKey regioncom.<object name> key com.<object-to-cache>#b31014c3-fde0-11dd-a96b-c0a8bd346be000 is locked under another transaction. Operation timeout expired.
        at com.j_spaces.map.GSMapImpl.internalGet(GSMapImpl.java:276)
        at com.j_spaces.map.GSMapImpl.internalGet(GSMapImpl.java:222)
        at com.j_spaces.map.AbstractMap.get(AbstractMap.java:268)
at org.openspaces.core.DefaultGigaMap.get(DefaultGigaMap.java:170)

/code

We tried changing the defaultWaitngForLockTimeout to 30 seconds but this problem still occurs. Here is our space configuration:

code
<bean id="map" class="org.openspaces.core.map.MapFactoryBean" lazy-init="true">
        <property name="space" ref="hibernateSpace" />
</bean>

<bean id="gigaMap" class="org.openspaces.core.GigaMapFactoryBean" lazy-init="true">
        <property name="map" ref="map" />
        <property name="transactionManager" ref="transactionManager"/>
        <property name="defaultWaitingForLockTimeout" value="30000" />
        <property name="defaultWaitForResponse" value="30000" />
</bean>

/code

We set <property name="defaultWaitForResponse" value="30000" /> however I don't think this is what we should be setting. Is there any other parameter we are missing?

Any help would be highly appreciated.

Cheers
Amin

This thread was imported from the previous forum.
For your reference, the original is available here

asked 2009-03-09 11:09:18 -0500

amin1977 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
0

If you get CacheTimeoutException you should rollback and retry the operation. Why won't you change the isolation level to allow concurrent read? Shay

answered 2009-03-09 11:53:59 -0500

shay hassidim gravatar image
edit flag offensive delete link more
0

Hi Shay

Thanks for your reply. There a couple of issues that we're not sure of:

1) TransactionalGigaMapCache with certain methods does operations on the GigaMap which is configured via spring and in some operations delegates the operation to IMap (with a comment that the operation is not part of a transaction).

2) AbstractMap (implements IMap) and GigaMap both have aproperty waitForResponse, the factory bean for GigaMap allows this property to be configured however the map factory bean ( org.openspaces.core.map.MapFactoryBean) does not allow this to be configured as a result the map uses the default wait time (which is no wait) which doesn't pass it as a parameter (for example put (key)).

3) We set the wait for response for both IMap and GigaMap to be 10 seconds. Now what are finding is that for each operation on space we are waiting for 10 seconds even though there are no locks on the data.

4) I'm also not sure why we have to do explicit retries, as I would have thought the correctly set waitForResponse/lockTimeOut time should do the trick.

Cheers Amin

answered 2009-03-10 06:30:39 -0500

amin1977 gravatar image
edit flag offensive delete link more

Comments

Amin, Can you provide a simple test case the mimics/reproduce this problem? Let's leave aside the Hibernate piece. If there are no locks there should not be any delay. I'm not 100% sure you are not conducting read operations without transactions (that might be the reason for the locked objects). Do you see transactions on the transaction list at the GS-UI/space browser panel and relevant objects locked when you read objects from the space? Shay

shay hassidim gravatar imageshay hassidim ( 2009-03-10 18:20:24 -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

Stats

Asked: 2009-03-09 11:09:18 -0500

Seen: 119 times

Last updated: Mar 10 '09