ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From amit.ro...@tcs.com
Subject Transaction handling
Date Sun, 20 Nov 2005 08:59:55 GMT

Please see below code snippets and details for the same.
I have 2 tables Table 1 and Table 2. Column from Table 1 form Foreign key 
in Table 2.

        sqlMap.startTransaction ();
        insert into Table 1
        select columns from Table1
        insert into Table 2 (select columns from Table1) // selecting 
record inserted on line 2 and trying to insert in Table 2
        sqlMap.commitTransaction ();

In above code I'm starting transaction. Inserting record in table 1. I'm 
able to select record on line no. 3. but when i execute line 4 i get error 
'parent key not found'
Please let me know your comments.

Thanks & Regards,
Amit Rogye


Notice: The information contained in this e-mail message and/or attachments to it may contain
confidential or privileged information.   If you are not the intended recipient, any dissemination,
use, review, distribution, printing or copying of the information contained in this e-mail
message and/or attachments to it are strictly prohibited.   If you have received this communication
in error, please notify us by reply e-mail or telephone and immediately and permanently delete
the message and any attachments.  Thank you
Mime
View raw message