Hi,

Sorry insisting. I may be doing a naive error. I would be grateful for any
suggestions. I've queried the mailing the archive unsuccessfully.

Thanks,
Ant�nio
PS. Is any one there using OJB in teaching classes?
----
Ant�nio Rito-Silva - [EMAIL PROTECTED] -
http://www.esw.inesc-id.pt/~ars
INESC-ID Software Engineering Group - Technical University of Lisbon


>-----Original Message-----
>From: Ant�nio Rito-Silva [mailto:[EMAIL PROTECTED]]
>Sent: ter�a-feira, 3 de Setembro de 2002 13:52
>To: OJB Users List
>Subject: Commit/Abort bug?
>
>
>Hi,
>
>When a execute the code below it does not insert Sito(2) and I get
>the error
>
>[org.apache.ojb.odmg.TransactionImpl] WARN: Abort transaction was called on
>tx org.apache.ojb.odmg.TransactionImpl@40c281, associated PB was null
>
>when I execute the abort.
>
>I am using MySQL and Serializable isolation property.
>
>What am I doing wrong?
>
>Thanks in advance,
>Ant�nio
>
>
>    public Application() {
>        Implementation odmg = OJB.getInstance();
>        Database db = odmg.newDatabase();
>        try {
>            db.open("ServidorPersistente/OJB/repository.xml",
>Database.OPEN_READ_WRITE);
>        } catch (ODMGException ex) {
>        }
>
>        // create an object
>        newSitio(1);
>        // create the same object - fails on commit and then fails on
>catch/abort
>        newSitio(1);
>        // create a different object - fails, does not create the object...
>        newSitio(2);
>    }
>
>    private void newSitio(int value) {
>        Implementation odmg = OJB.getInstance();
>        Transaction tx = odmg.newTransaction();
>        try {
>            ISitio sitio = null;
>            tx.begin();
>            sitio = new Sitio(value);
>            tx.lock(sitio, tx.WRITE);
>            tx.commit();
>        } catch (Exception ex) {
>            try {
>                tx.abort();
>            } catch (Exception exx) {
>            }
>        }
>    }
>
>    public static void main(String [] args) {
>        Application app = new Application();
>    }
>
>
>--
>To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to