glassfish
  1. glassfish
  2. GLASSFISH-20167

JTS5041: The resource manager is doing work outside a global transaction

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      Hi Team,
      I am getting the issue of "The resource manager is doing work outside a global transaction" repetitively. The application is deployed on GlassFish 2.1
      Following are the logs:

      [#|2013-04-03T18:08:44.160+0200|INFO|sun-appserver2.1|no.ergo.online.ValiderGodsLM|_ThreadID=27;_ThreadName=httpSSLWorkerThread-18964-0;|Skip LM-check of 370713750147808441 since Tur-,Stopp-,Lok.-idents not set.|#]

      [#|2013-04-03T18:08:44.197+0200|WARNING|sun-appserver2.1|javax.enterprise.resource.resourceadapter|_ThreadID=27;_ThreadName=httpSSLWorkerThread-18964-0;_RequestID=abf23d84-82d8-42ba-a763-4fb5be0b2aaf;|poolmgr.err_enlisting_res_in_getconn|#]

      [#|2013-04-03T18:08:44.179+0200|WARNING|sun-appserver2.1|javax.enterprise.system.core.transaction|_ThreadID=27;_ThreadName=httpSSLWorkerThread-18964-0;_RequestID=abf23d84-82d8-42ba-a763-4fb5be0b2aaf;|JTS5041: The resource manager is doing work outside a global transaction
      javax.transaction.xa.XAException: XAER_RMERR: A resource manager error occurred in the transaction branch.
      at net.sourceforge.jtds.jdbc.XASupport.raiseXAException(XASupport.java:677)
      at net.sourceforge.jtds.jdbc.XASupport.xa_start(XASupport.java:203)

        Activity

        Hide
        marina vatkina added a comment -

        If Class C is not a component and doesn't do anything on a separate thread, it should all be fine.... The connection should be closed at the end of the method that created it.

        Show
        marina vatkina added a comment - If Class C is not a component and doesn't do anything on a separate thread, it should all be fine.... The connection should be closed at the end of the method that created it.
        Hide
        shavet11 added a comment -

        Yes Class C is not a component and not doing anything on a separate thread.. Thanks.. Anyways now the error is not coming after increasing the heap size.. But can you please suggest what could be the possible reasons for the error ? And how can it be avoided in the future ?

        Thanks in Advance..

        Show
        shavet11 added a comment - Yes Class C is not a component and not doing anything on a separate thread.. Thanks.. Anyways now the error is not coming after increasing the heap size.. But can you please suggest what could be the possible reasons for the error ? And how can it be avoided in the future ? Thanks in Advance..
        Hide
        marina vatkina added a comment -

        It might have been a datasource issue (that it didn't have enough memory) or a connection pooling issue (did you turn on connection validation?) or some internal GF issue - it's hard to tell without a test case.

        Show
        marina vatkina added a comment - It might have been a datasource issue (that it didn't have enough memory) or a connection pooling issue (did you turn on connection validation?) or some internal GF issue - it's hard to tell without a test case.
        Hide
        shavet11 added a comment - - edited

        Hi Marina..

        I think that you are right..the error occurs when getting a connection from the datasource.. The line of code from where the error initiates is following :

        public Connection getConnection() throws SQLException

        { return getDataSource().getConnection(); }

        The getDataSourc() method returns a javax.sql.DataSource object and using this object, connection is retrieved..

        The server logs show the error at the following line:

        return getDataSource().getConnection();

        Should I increase the connection pool size("Maximum Pool Size" property) because the error occurs almost daily only when the load (number of requests) is at its peak..At other times the behavior is normal..

        Also, currently I am not doing the connection validation. I think its a good idea to enable it (using the table type validation as its more reliable than "auto-commit")... Only thing is :Does it have any side effects such as overhead?

        Thanks in Advance..

        Show
        shavet11 added a comment - - edited Hi Marina.. I think that you are right..the error occurs when getting a connection from the datasource.. The line of code from where the error initiates is following : public Connection getConnection() throws SQLException { return getDataSource().getConnection(); } The getDataSourc() method returns a javax.sql.DataSource object and using this object, connection is retrieved.. The server logs show the error at the following line: return getDataSource().getConnection(); Should I increase the connection pool size("Maximum Pool Size" property) because the error occurs almost daily only when the load (number of requests) is at its peak..At other times the behavior is normal.. Also, currently I am not doing the connection validation. I think its a good idea to enable it (using the table type validation as its more reliable than "auto-commit")... Only thing is :Does it have any side effects such as overhead? Thanks in Advance..
        Hide
        marina vatkina added a comment -

        Connection validation shouldn't be expensive if the sql query is very simple. But the cause of the error is a bug either in the driver or in GF.

        Show
        marina vatkina added a comment - Connection validation shouldn't be expensive if the sql query is very simple. But the cause of the error is a bug either in the driver or in GF.

          People

          • Assignee:
            michael.y.chen
            Reporter:
            shavet11
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: