try {   engine.create( this, object, identity ); } catch ( DuplicateIdentityException except ) { removeObjectEntry( object ); throw except; } catch ( PersistenceException except ) { removeObjectEntry( object ); throw except;
if ( identity != null ) { try {   engine.create( this, object, identity ); } catch ( DuplicateIdentityException except ) { removeObjectEntry( object ); throw except; } catch ( PersistenceException except ) { removeObjectEntry( object ); throw except; }
    public synchronized OID create( PersistenceEngine engine, Object object, Object identity )        throws TransactionNotInProgressException, DuplicateIdentityException,               ClassNotPersistenceCapableException, PersistenceException    {        OID          oid;        ObjectEntry  entry;        ClassHandler handler;        /*        if ( _status != Status.STATUS_ACTIVE && _status != Status.STATUS_MARKED_ROLLBACK )            throw new TransactionNotInProgressException();        */        // Make sure the object has not beed persisted in this transaction.        if ( getObjectEntry( object ) != null )            throw new PersistenceExceptionImpl( "persist.objectAlreadyPersistent", object.getClass(), identity );        handler = engine.getClassHandler( object.getClass() );        if ( handler == null )            throw new ClassNotPersistenceCapableException( Messages.format( "persist.classNotPersistenceCapable", object.getClass().getName() ) );        // Create the object. This can only happen once for each object in        // all transactions running on the same engine, so after creation        // add a new entry for this object and use this object as the view        if ( identity != null && getObjectEntry( engine, new OID( handler, identity ) ) != null )            throw new DuplicateIdentityException( Messages.format( "persist.duplicateIdentity", object.getClass().getName(), identity ) );        oid = new OID( handler, identity );        entry = addObjectEntry( object, oid, engine );        entry.created = true;        try {            // Must perform creation after object is recorded in transaction            // to prevent circular references.            engine.create( this, object, identity );        } catch ( DuplicateIdentityException except ) {            removeObjectEntry( object );            throw except;        } catch ( PersistenceException except ) {            removeObjectEntry( object );            throw except;        }        return oid;    }