db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John M <wu...@mailandnews.com>
Subject mysql and native seq mgr
Date Thu, 02 Oct 2003 17:22:05 GMT
Currently in PlatformMySQLImpl, the last insert query looks like this:

    public String getLastInsertIdentityQuery(String tableName)
    {
        return LAST_INSERT + tableName + LIMIT;
    }


This gets called if you use SequenceManagerNativeImpl.  However, "SELECT 
LAST_INSERT_ID() table1 LIMIT 1" fails on mysql 3.2x.  It does work on 4x.  
I'm not an expert, but MySQL doesn't need anything except "SELECT 
LAST_INSERT_ID()" to work.  The id is stored per connection, not table, and 
it's just a function that always returns 1 value.  Could this be patched to 
provide greater MySQL compatability?  I think I had previously changed this on 
SequenceManagerMySQLImpl because it was the same way, but it seems like the 
native impl is the way to go now.

John Marshall
Connectria


---------------------------------------------------------------------
To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org


Mime
View raw message