Hello everybody,
An off-topic question (it's Friday, I hope you accept it!): 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; I have a fundamental doubt: Does JTA allows me to delimit (and perform) 2 independent, yet concurrent transactions??? For instance: 2 users that click the "delete" button 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? Is JTA able, in any way, to differentiate the Transaction begun from each user's corresponding instance of the respective BO (the one they wanted to delete... i.e. the father, not its children)??? I'd appreciate any light you can shed on this matter. Thanks and regards, Freddy.