ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Clinton Begin <clinton.be...@gmail.com>
Subject Re: Transaction handling
Date Mon, 21 Nov 2005 16:18:48 GMT
Your database may be validating foreign key relationships before the
commit...


Cheers,
Clinton

On 11/20/05, amit.rogye@tcs.com <amit.rogye@tcs.com> wrote:
>
>
> 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.
>
>    1. sqlMap.startTransaction ();
>    2. insert into Table 1
>    3. select columns from Table1
>    4. insert into Table 2 (select columns from Table1) // selecting
>    record inserted on line 2 and trying to insert in Table 2
>    5. 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