2 Replies Latest reply on Nov 8, 2006 8:01 PM by nekop

    StackTrace appears stderr when session.processSessionRepl()

      Hi,

      I'm using JBoss AS 4.0.5.GA and setting up Tomcat Cluster Service.

      Under high load, org.jboss.cache.lock.TimeoutException occurred at session.processSessionRepl(). It's ok, but JBossCacheManager dumps stack trace into stderr if there is no tx.

      JBossCacheManager is doing:

       protected void processSessionRepl(ClusteredSession session)
       {
       // If we are using SESSION granularity, we don't want to initiate a TX
       // for a single put
       boolean notSession = (replicationGranularity_ != WebMetaData.REPLICATION_GRANULARITY_SESSION);
       boolean doTx = false;
       try
       {
       // We need transaction so all the replication are sent in batch.
       // Don't do anything if there is already transaction context
       // associated with this thread.
       if(notSession && tm.getTransaction() == null)
       doTx = true;
      
       if(doTx)
       tm.begin();
      
       // Tell the proxy to ignore cache notifications we are about
       // to generate for this session. We have to do this
       // at this level because we don't want to resume handling
       // notifications until any compensating changes resulting
       // from a tx rollback are done.
       SessionReplicationContext.startCacheActivity();
      
       session.processSessionRepl();
       }
       catch (Exception ex)
       {
       if (log_.isDebugEnabled())
       log_.debug("processSessionRepl(): failed with exception", ex);
      
       try
       {
      // if(doTx)
       // Let's set it no matter what.
       tm.setRollbackOnly();
       }
       catch (Exception exn)
       {
       exn.printStackTrace();
       }
       // We will need to alert Tomcat of this exception.
       if (ex instanceof RuntimeException)
       throw (RuntimeException) ex;
      
       throw new RuntimeException("JBossCacheManager.processSessionRepl(): " +
       "failed to replicate session.", ex);
       }
       finally
       {
       try {
       if(doTx)
       endTransaction(session.getId());
       }
       finally {
       SessionReplicationContext.finishCacheActivity();
       }
       }
       }
      


      1. The notSession is true and the doTx is false since i'm using SESSION granularity.
      2. JBossCacheManager doesn't call tm.begin() but calls tm.setRollbackOnly() when TimeoutException occurred.
      3. tm.setRollbackOnly() throws IllegalStateException since there is no tx.
      4. JBossCacheManager dumps stack trace into stderr.

      Is this expected behavior?