-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Multi-transactional issue (details inside)
PostPosted: Mon Nov 08, 2010 2:44 pm 
Newbie

Joined: Mon Nov 08, 2010 12:06 pm
Posts: 1
Hi, all. I'm totally stuck with following scenario.

I have entity A which identified by business key id. So when we create A we specify ID rather than let Hibernate generate it. Imagine it, i.e. as user, identified by username.
I have also entity B which is related as many-to-one to entity A, and which is identified by generated ID. Relation is unidirectional, A knows nothing about B. Imagine it, i.e. as messages issued by user.

Let us simultaneously launch a bunch of transactions that mean: create new B related to A, identified by same ID. At the moment all transactions start, we do not have such A in database. How to make sure that all transactions create only one A and lots of B-s?

Well yeah, I can do it with additional transaction launched by future-based cache, but transactions are RESOURCE_LOCAL and future can return some initialized result before data will be actually commited, and other transactions trying to use this data will fail.

Thanks in advance for help


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.