I found an instance when a JDO rollback() failed to remove a newly created object.
This is using a Castor Nightly build from 4 days ago and MySQL 3.23 using a MyISAM
database (non transactional).

I had the following sequence of code

try {
    db = getDatabase("system");
    db.begin();
    User user = new User();
    // Set some properties for the object which is mapped
    // with key-generator="IDENTITY"
    db.create(user);
    int id = ((Integer)db.getIdentity(user)).intValue();
    // Do some non JDO related things

    // The non JDO thing throws an Exception

    // This commit is never reached do to an Exception being thrown
    db.commit()
} catch(Exception e) {
    if( db != null )
        // The rollback should make sure that the user added with db.create()
        // is not persisted to the database
        db.rollback();
}

Even after doing a normal shutdown of the application, the database 
contained a record for the object created above.

Is this a bug, or is this due to MySQL?

Thanks,

Glenn

----------------------------------------------------------------------
Glenn Nielsen             [EMAIL PROTECTED] | /* Spelin donut madder    |
MOREnet System Programming               |  * if iz ina coment.      |
Missouri Research and Education Network  |  */                       |
----------------------------------------------------------------------

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to