ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tat Leong Chong <tlchong...@yahoo.com>
Subject RE: Feature of resultset.getGeneratedKeys
Date Wed, 02 Nov 2005 08:23:29 GMT
http://dev.mysql.com/tech-resources/articles/autoincrement-with-connectorj.html
 
If you go to this web site, the mysql has categoried the select last_insert_id as non thread
safe. But again it depends how the programming that involved using the same statement instance
or not. 
 
I think let go for the the vote to upgrade the priority of this feature in IBATIS would be
the best step. Whether other database driver would support this, I am sure it's matter of
time.
 
Regards

John Hurst <jbhurst@attglobal.net> wrote:
I don't know if the question is just for MySQL, but in my tests of Firebird
with the Jaybird driver I found that it screws this up.

That is, if you do

SELECT GEN_ID(gen_song, 1) FROM rdb$database -- increments

And then later in the same thread with the same Connection:

SELECT GEN_ID(gen_song, 0) FROM rdb$database -- gets current

You can get a different answer!

I found this disappointing. I believe the Firebird doc states or at least
hints that this is the behavior, but I cannot find the reference just now.

Regards

John Hurst 
Wellington
> -----Original Message-----
> From: larry.meadors@gmail.com [mailto:larry.meadors@gmail.com] On Behalf
> Of Larry Meadors
> Sent: Wednesday, 2 November 2005 18:53
> To: user-java@ibatis.apache.org
> Subject: Re: Feature of resultset.getGeneratedKeys
> 
> 1) Nope.
> 
> 2) Depends on the driver, but in every case I have seen, no.
> 
> Larry
> 
> 
> On 11/1/05, Tat Leong Chong wrote:
> > Hi,
> >
> > I am new to Ibatis and using MySQL for company
> > MIS development. We found the new feature in JDK1.5
> > for getGeneratedKeys.
> >
> > 1. I am curious that is the current version 2.1.5
> > Ibatis already support this feature instead of using
> > the Select LAST_INSERT_ID() as id
> > ?
> >
> > 2. In the current version of IBATIS, 
> > Select LAST_INSERT_ID() as id to get the
> > auto-increment key. Would this have any problem in
> > many user access environment like the key is taken by
> > other thread?
> >
> > Thanks.
> >
> > Regards,
> > Tat
> >
> >
> >
> >
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Tired of spam? Yahoo! Mail has the best spam protection around
> > http://mail.yahoo.com


		
---------------------------------
 Yahoo! FareChase - Search multiple travel sites in one click.  
Mime
View raw message