• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1151
  • Last Modified:

Jboss Transaction XidImpl timed out. status=STATUS_ACTIVE

Hello ,

     We are using Jboss 2.4.3, Tomcat 3.2.3, jdk 1.3, postgres 7.2.1  running on Red Hat Linux 7.2

The Jboss server stops responding occassionally(1 to 2 times in a week). The jboss fails to get a connection object giving following errors.



Transaction XidImpl [FormatId=257, GlobalId=xx1.dummyhost.com//3142, BranchQual=] timed out. status=STATUS_ACTIVE

                     
                        OR


java.lang.NullPointerException
[Default]      at org.jboss.pool.jdbc.xa.XAPoolDataSource.getConnection(XAPoolDataSource.java:178)
[Default]
[Default]      at com.davs.lsw.ejb.generic.GenericBean.updateUsersTable(GenericBean.java:514)
[Default]
[Default]      at java.lang.reflect.Method.invoke(Native Method)
[Default]
[Default]      at org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:543)
[Default]
[Default]      at org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:87)
[Default]
[Default]      at org.jboss.ejb.plugins.TxInterceptorCMT.invokeNext(TxInterceptorCMT.java:133)
[Default]
[Default]      at org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:307)
[Default]
[Default]      at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:99)
[Default]
[Default]      at org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:128)
[Default]
[Default]      at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:195)
[Default]
[Default]      at org.jboss.ejb.StatelessSessionContainer.invoke(StatelessSessionContainer.java:286)
[Default]
[Default]      at org.jboss.ejb.plugins.jrmp.server.JRMPContainerInvoker.invoke(JRMPContainerInvoker.java:395)
[Default]
[Default]      at java.lang.reflect.Method.invoke(Native Method)
[Default]
[Default]      at sun.rmi.server.UnicastServerRef.dispatch(UnicastServerRef.java:236)
[Default]
[Default]      at sun.rmi.transport.Transport$1.run(Transport.java:147)
[Default]
[Default]      at java.security.AccessController.doPrivileged(Native Method)
[Default]
[Default]      at sun.rmi.transport.Transport.serviceCall(Transport.java:143)
[Default]
[Default]      at sun.rmi.transport.tcp.TCPTransport.handleMessages(TCPTransport.java:460)
[Default]
[Default]      at sun.rmi.transport.tcp.TCPTransport$ConnectionHandler.run(TCPTransport.java:701)
[Default]
[Default]      at java.lang.Thread.run(Thread.java:479)

 
     
  My Jboss.jcml configration includes


<mbean code="org.jboss.jdbc.XADataSourceLoader" name="DefaultDomain:service=XADataSource,name=DefaultDS">
<attribute name="DataSourceClass">org.jboss.pool.jdbc.xa.wrapper.XADataSourceImpl</attribute>
<attribute name="PoolName">DefaultDS</attribute>
<attribute name="URL">jdbc:postgresql://xx.yy.zz.pp:5432/testdb</attribute>
<attribute name="JDBCUser">username</attribute>
<attribute name="Password">passwd</attribute>
<attribute name="GCMinIdleTime">1200000</attribute>
<attribute name="MaxSize">10</attribute>
<attribute name="GCEnabled">false</attribute>
<attribute name="InvalidateOnError">false</attribute>
<attribute name="TimestampUsed">false</attribute>
<attribute name="Blocking">true</attribute>
<attribute name="GCInterval">120000</attribute>
<attribute name="IdleTimeout">1800000</attribute>
<attribute name="IdleTimeoutEnabled">false</attribute>
<attribute name="LoggingEnabled">false</attribute>
<attribute name="MaxIdleTimeoutPercent">1.0</attribute>
<attribute name="MinSize">0</attribute>
</mbean>


Hope this information will help. Waiting for a responce.

Thanks in advance








   
0
sunithas
Asked:
sunithas
  • 3
  • 3
1 Solution
 
TimYatesCommented:
I had this too with JBoss 2.4...

I'm trying to remember what it was...
0
 
TimYatesCommented:
Ok, I think I remembered...

We basically had a problem that when a connection to the database returned corrupted data (we were using Oracle, and BLOBs are a pain), it corrupted that connection in the Pool, so anything using that connection at a later date would crash...

It could also cause the transaction to take longer than the default time in jboss.jcml, and that's why you get the "STATUS_ACTIVE" error...  that's a transaction not returning fast enough....

The best recomendation I can give you, is to get the latest 2.xx JBoss there is, and the latest JDBC drivers, and try it with that

If that doesn't work, I'd put logging into your beans, so you can see which method is being called that is locking

And maybe changing the Transaction attributes for that method from "Requires", to "Requires new"

Or if that method MAY take longer than your timeout time, then increase your timeout time...

Also, I'd check your data for the thing you are trying to fetch when it locks (or the one before)...  As I say, we kept getting bad BLOB data in our Oracle database (mainly because it was set up by fools, and running on a machine that was set up wrong), and it was this that was corrupting our SQL connections...

Good luck!!

Hope this helps, even a little bit :-/

I remember, and feel your pain :-/

Tim.
0
 
sunithasAuthor Commented:
My server had almost no clients. There was only one client and he was also idle for long time. After a while when i tried to log in i had this problem which said time out

Transaction XidImpl [FormatId=257, GlobalId=xx1.dummyhost.com//3142, BranchQual=] timed out. status=STATUS_ACTIVE

My point is, the problem is not with load it has to be some where else. If someone has any idea please let me know

thanks in advance




0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
sunithasAuthor Commented:
My server had almost no clients. There was only one client and he was also idle for long time. After a while when i tried to log in i had this problem which said time out

Transaction XidImpl [FormatId=257, GlobalId=xx1.dummyhost.com//3142, BranchQual=] timed out. status=STATUS_ACTIVE

My point is, the problem is not with load it has to be some where else. If someone has any idea please let me know

thanks in advance




0
 
sunithasAuthor Commented:
Hello ,

   WE have solved the problem successufully.
The basic problem was in one of the servlets we did not close data base connection due to which connections were not restoring.

How we solved this problem is:

in the jboss logs we changed in the jboss.jcml the attribute logging to true which bascially tells about the status of pooling.
on observing our log files we could trace the root of the problem.....

Hope this will help some one solve their problem.....



0
 
TimYatesCommented:
Woo!

I'm glad you solved it :-)  It is a HORRIBLE one to track down :-(

I have a centralised close connection method:

  public static void closeConnection( Connection connection, Statement statement, ResultSet resultSet )
  {
    try
    {
      if (resultSet != null)
      {
        resultSet.close();
      }
    }
    catch(SQLException e)
    {
    }
    try
    {
      if (statement != null)
      {
        statement.close();
      }
    }
    catch(SQLException e)
    {
    }
    try
    {
      if (connection != null)
      {
        connection.close();
      }
    }
    catch(SQLException e)
    {
    }
  }

Which I call in a finally block from anywhere I use a connection...just to be sure :-)

Not much use to you now tho ;-)

0
 
CleanupPingCommented:
sunithas:
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now