aspose file tools*
The moose likes Object Relational Mapping and the fly likes timeout when calling refresh() on entities with CacheConcurrencyStrategy NONSTRICT_READ_WRITE Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "timeout when calling refresh() on entities with CacheConcurrencyStrategy NONSTRICT_READ_WRITE" Watch "timeout when calling refresh() on entities with CacheConcurrencyStrategy NONSTRICT_READ_WRITE" New topic
Author

timeout when calling refresh() on entities with CacheConcurrencyStrategy NONSTRICT_READ_WRITE

John Bengler
Ranch Hand

Joined: Feb 12, 2009
Posts: 133
Hi all,

I've got a problem...

I want to call refresh() directly after merging entities (to update also attributes which may have been set by database triggers, etc.).

This works fine for uncached entities and also for entities wich are cached, but have the CacheConcurrencyStrategy TRANSACTIONAL.

But for entitites with CacheConcurrencyStrategy NONSTRICT_READ_WRITE I get an timeout error...

I'm using EJB3 entities on JBoss eap 4.2.0.

Does anyone know why? I've set the concurrency for some entities to NONSTRICT_READ_WRITE because of locking problems between sessions and would like to keep it..

The code which does the merge/refresh (oView is a DTO):


This works:



With this I've got the error below:




Here's an excerpt from the stacktrace:

John Bengler
Ranch Hand

Joined: Feb 12, 2009
Posts: 133
Just to let you know: I had an idea, but it didn't work out...

I thought if this has to do with the caching, then let's remove the entities if they have the "problematic" concurrency strategy....

But it didn't help..
John Bengler
Ranch Hand

Joined: Feb 12, 2009
Posts: 133
Now I found a solution which at least works...

I'm setting the CacheMode for this session to IGNORE.
(via session.setCacheMode(CacheMode.IGNORE);)

But I'm still not very happy with this - especially because I still don't understand what's the problem.


Can anyone explain me this behavior?



John
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: timeout when calling refresh() on entities with CacheConcurrencyStrategy NONSTRICT_READ_WRITE