Freddy,

You may want to take a look at Hibernate (http://www.hibernate.org), if you
haven't done so already.

Hibernate is a persistence mechanism which utilizes XML mappings to map
Java objects to relational database schemas, and does support cascading
deletes, amoung other things.


HTH,
Ian



                                                                                       
                                
                    "Freddy Villalba Arias"                                            
                                
                    <[EMAIL PROTECTED]       To:     <[EMAIL PROTECTED]>               
              
                    matica.es>                    cc:                                  
                                
                                                  Subject:     [OT] JTA, JDBC and data 
persistence                     
                    03/26/2004 10:59 AM                                                
                                
                    Please respond to                                                  
                                
                    "Struts Users Mailing                                              
                                
                    List"                                                              
                                
                                                                                       
                                
                                                                                       
                                




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.







This transmission may contain information that is privileged, confidential and/or 
exempt from disclosure under applicable law. If you are not the intended recipient, 
you are hereby notified that any disclosure, copying, distribution, or use of the 
information contained herein (including any reliance thereon) is STRICTLY PROHIBITED. 
If you received this transmission in error, please immediately contact the sender and 
destroy the material in its entirety, whether in electronic or hard copy format. Thank 
you.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to