dcsimg
Differentiate 2 concurrent transactions
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Freddy_Villalba
Posted On:   Friday, March 26, 2004 08:37 AM

Hello everybody, I want to implement a Business Object Model on top of many DAOs. Those BOs will be - obviously - related to each other (mainly 1:n and m:n relationships). I must implement this in such way that, when - for example - deleting a BO that has 3 children associated (therefore, those must be deleted as well), it's is possible to do so atomically. That is, I need to be able to delimit the beginning and the end of the transaction that spans the delete operation on those 4 objects. I want this to be as transparent and "elegant" as possible. I believe the right choice for solving this is using JTA objects (that is "XA" objects) instead of plain JDBC. I've    More>>

Hello everybody,




I want to implement a Business Object Model on top of many DAOs. Those BOs will be - obviously - related to each other (mainly 1:n and m:n relationships).




I must implement this in such way that, when - for example - deleting a BO that has 3 children associated (therefore, those must be deleted as well), it's is possible to do so atomically. That is, I need to be able to delimit the beginning and the end of the transaction that spans the delete operation on those 4 objects.




I want this to be as transparent and "elegant" as possible. I believe the right choice for solving this is using JTA objects (that is "XA" objects) instead of plain JDBC. I've been reading the API and some papers regarding JTA (yes, I'm a newbie to JTA); I have a fundamental doubt:






Does JTA allow delimiting (and performing) 2 independent, yet concurrent transactions (they are not nested)? How is it done? For example: imagine you have two users (again, it's a web-app), one clicks the "delete category" button (which implies deleting all products) and the other clicks the "delete user" button, both at the same time (it's a web application).




I haven't seen anything like a transaction ID or similar on any example I've examined. Is this issue transparent to me? How does JTA differentiate concurrent transactions originated from different objects (instances)?




I read something about JTA being able to differentiate the transactions based on the thread the request (for that transaction) came from... how would that fit in a web-app environment (each user would have its own copy of the objects, stored in their corresponding Session)? Is it responsability of the Servlet Container to provide a different transaction (object) to each process (client)? What about concurrency management?




I'd appreciate any light you can shed on this matter.






Thanks and regards,

Freddy.

   <<Less
About | Sitemap | Contact