The result is, that I get no exception but also no result! It simply passes by with no SQL being executed. I integrated P6Spy for debugging of the SQL and it also shows no statement being mad (no delete or so).
Anything else to try? It seems to me, I've tried already all combinations. Julia. -----Urspr�ngliche Nachricht----- Von: Armin Waibel [mailto:[EMAIL PROTECTED] Gesendet: Mittwoch, 9. Juli 2003 18:11 An: OJB Users List Betreff: Re: transaction in JBoss with MySQL Datasource > I tried this alread. This will give me an: sorry, overlooked that! > org.odmg.TransactionNotInProgressException: No external transaction > found Seems OJB is not associated with JTA transaction. Can you try UserTransaction utx = ... utx.begin() odmg.currentTransaction(); db.deletePersistent(toBeDeleted); /* here it crashes */ utx.commit() What's the result now? regards, Armin ----- Original Message ----- From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, July 09, 2003 3:46 PM Subject: AW: transaction in JBoss with MySQL Datasource Hello Armin, I tried this alread. This will give me an: org.odmg.TransactionNotInProgressException: No transaction in progress, cannot delete persistent at org.apache.ojb.odmg.DatabaseImpl.deletePersistent(Unknown Source) at de.arvatosystems.monitoring.integration.dao.server.ServerOjbDAO.delete(S erve rOjbDAO.java:230) The Operation on the database crashes. Other suggestions? Julia. -----Urspr�ngliche Nachricht----- Von: Armin Waibel [mailto:[EMAIL PROTECTED] Gesendet: Mittwoch, 9. Juli 2003 15:38 An: OJB Users List Betreff: Re: transaction in JBoss with MySQL Datasource Hi, try to use JTA UserTransaction or container-managed tx and do not use ODMG tx-declaration. UserTransaction utx = ... utx.begin() > db.deletePersistent(toBeDeleted); /* here it crashes */ utx.commit() HTH regards, Armin ----- Original Message ----- From: <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Wednesday, July 09, 2003 3:25 PM Subject: transaction in JBoss with MySQL Datasource > Hello! > > I' using JBoss 3.0.6, OJB rc3 and a MySQL Database, which is configured as a > Datasource for Local Transaction. > > I'm trying to delete an object but I'm having some problems with the > transaction. I have tried several things with the following results: > > --------------------- > 1. Use only of org.odmg.Transaction: > > Transaction tx = odmg.currentTransaction(); > if ( !tx.isOpen()) > tx.begin(); > db.deletePersistent(toBeDeleted); /* here it crashes */ > tx.commit(); > > Result: > org.odmg.TransactionNotInProgressException: No external transaction found > at org.apache.ojb.odmg.JTATxManager.registerTx(Unknown Source) > at org.apache.ojb.odmg.TransactionImpl.begin(Unknown Source) > at org.apache.ojb.odmg.OJBJ2EE_2.beginInternTransaction(Unknown > Source) > at org.apache.ojb.odmg.OJBJ2EE_2.currentTransaction(Unknown Source) > at > de.arvatosystems.monitoring.integration.dao.server.ServerOjbDAO.delete(S erve > rOjbDAO.java:227) > > ------------------- > 2. Use only of UserTranscation: > UserTransaction userTx = (UserTransaction) > context.lookup("java:/comp/UserTransaction"); > userTx.begin(); > db.deletePersistent(toBeDeleted); /* here it crashes */ > userTx.commit(); > > Result: > org.odmg.TransactionNotInProgressException: No transaction in progress, > cannot delete persistent > at org.apache.ojb.odmg.DatabaseImpl.deletePersistent(Unknown Source) > at > de.arvatosystems.monitoring.integration.dao.server.ServerOjbDAO.delete > (ServerOjbDAO.java:230) > > --------------------- > 3. Use of both (Transaction and UserTransaction combined): > > UserTransaction userTx = (UserTransaction) > context.lookup("java:/comp/UserTransaction"); > userTx.begin(); > Transaction tx = odmg.currentTransaction(); > if ( !tx.isOpen()) > tx.begin(); > db.deletePersistent(toBeDeleted); > tx.commit(); /* here it crashes */ > userTx.commit(); > > Result: > java.lang.UnsupportedOperationException: Not supported operation > at org.apache.ojb.odmg.NarrowTransaction.commit(Unknown Source) > at > de.arvatosystems.monitoring.integration.dao.server.ServerOjbDAO.delete(S erve > rOjbDAO.java:232) > > --------------------- > 4. like 3 but I uncomment tx.commit(). No exceptions but the object is not > deleted. No SQL statement is generated by OJB. > > > I know it is a lot to read but maybe somebody can take some time to read my > code. > Where is my problem and which transactions should I use? Or is the > configuration of my Datasource wrong? > > Thanks, Julia. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
