db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <de...@segel.com>
Subject RE: Foreign keys cuases deadlock?
Date Thu, 19 Feb 2009 13:21:10 GMT
Let me see if I have this straight.

Auto commit is off.

You're trying the following pseudo code...

Begin transaction
  Insert into table 1
    Get some return code from the insert for your foreign key for table 2
  Insert into table 2
Commit Transaction

And this is failing?


> -----Original Message-----
> From: Mikael Sundberg [mailto:Mikael.Sundberg@artificial-solutions.com]
> Sent: Thursday, February 19, 2009 7:08 AM
> To: Derby Discussion
> Subject: Foreign keys cuases deadlock?
> 
> Hi I have the following problem.
> 
> Im using autocommit off.
> I start by inserting into table1.
> 
> I then want to insert into table2 that has a foreign key to table 1. (I
> use generatedkeys from my insert)
> This fails since it cant obtaing a lock on table1
> Is that expected?
> If I add a commit between the two statements it works.
> 
> /Micke



Mime
View raw message