3 Replies Latest reply on May 4, 2002 12:59 AM by joek

    TransactionRolledbackException in RC2

    joek

      Hi

      I am running JBoss 3.0RC2, SQL Server 7 with the Atinav driver.

      I am calling an entity bean from a session bean. I get the following error and I can't figure out why. I also got the same error in RC1. I am using 'Required transaction attribute on both beans.


      002-05-03 22:04:30,726 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCEJBQLQuery.CustDataEJB.findByCompanyName] Executing SQL: SELECT t0_o.fldIDCode FROM tblcompany2 t0_o WHERE t0_o.fldCompanyName = ?
      2002-05-03 22:04:31,036 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.CustDataEJB] Executing SQL: SELECT fldCompanyName FROM tblcompany2 WHERE (fldIDCode=?)
      2002-05-03 22:04:31,046 ERROR [org.jboss.ejb.plugins.LogInterceptor] TransactionRolledbackException, causedBy:
      java.sql.SQLException: [aveConnect][JDBC SQL Server Driver] Only one statement is allowed in transaction mode.
      at net.avenir.jdbc2.a.b(Unknown Source)
      at net.avenir.jdbc2.m.b(Unknown Source)
      at net.avenir.jdbc2.m.executeQuery(Unknown Source)
      at org.jboss.resource.adapter.jdbc.local.LocalPreparedStatement.executeQuery(LocalPreparedStatement.java:289)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.execute(JDBCLoadEntityCommand.java:115)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.execute(JDBCLoadEntityCommand.java:62)
      at org.jboss.ejb.plugins.cmp.jdbc.JDBCStoreManager.loadEntity(JDBCStoreManager.java:489)
      at org.jboss.ejb.plugins.CMPPersistenceManager.loadEntity(CMPPersistenceManager.java:410)
      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.loadEntity(CachedConnectionInterceptor.java:314)
      at org.jboss.ejb.plugins.EntitySynchronizationInterceptor.invoke(EntitySynchronizationInterceptor.java:283)
      at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.invoke(CachedConnectionInterceptor.java:147)
      at org.jboss.ejb.plugins.EntityInstanceInterceptor.invoke(EntityInstanceInterceptor.java:193)
      at org.jboss.ejb.plugins.EntityLockInterceptor.invoke(EntityLockInterceptor.java:107)
      at org.jboss.ejb.plugins.EntityCreationInterceptor.invoke(EntityCreationInterceptor.java:69)
      at org.jboss.ejb.plugins.AbstractTxInterceptor.invokeNext(AbstractTxInterceptor.java:96)
      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:167)
      at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:61)
      at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:129)
      at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:166)
      at org.jboss.ejb.EntityContainer.invoke(EntityContainer.java:493)
      at org.jboss.ejb.plugins.local.BaseLocalContainerInvoker.invoke(BaseLocalContainerInvoker.java:296)
      at org.jboss.ejb.plugins.local.EntityProxy.invoke(EntityProxy.java:38)
      at $Proxy30.getAddress(Unknown Source)
      at com.iOrigo.cust.CustInfoManagerEJB.getCompanyAddress(CustInfoManagerEJB.java:179)
      at java.lang.reflect.Method.invoke(Native Method)
      at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:664)
      .
      .

      The piece of gode that generates the error is:
      try {

      CustDataLocalHome home = (CustDataLocalHome) getCustDataHome();
      CustDataLocal customer = (CustDataLocal) home.findByCompanyName(name);
      Collection allAddr = customer.getAddress();
      .
      .
      .

      Any help would be appreciated...

        • 1. Re: TransactionRolledbackException in RC2
          davidjencks

          What does the atinav or m$ docs say about the exception you are getting? It (the exception) doesn't make any sense to me. Some drivers seem to require odd additions to their urls about cursors, maybe this is one such.

          • 2. Re: TransactionRolledbackException in RC2
            joek

            David, thanks for the quick(!) response.

            I could not find anything in the atinav docs. I also looked through the $10 docs but nothing.

            I'll keep diggin into this and post whatever I find.

            • 3. Re: TransactionRolledbackException in RC2
              joek

              The problem was due to the driver. Atinav supplies two versions, one optimized for memory the other for connections. If you use the memory-optimized version, you may get this error. After switching to the other, the error went away.