?
Solved

Jboss Transaction XidImpl  timed out. status=STATUS_ACTIVE

Posted on 2003-03-04
7
Medium Priority
?
1,102 Views
Last Modified: 2012-06-27
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
Comment
Question by:sunithas
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
7 Comments
 
LVL 35

Expert Comment

by:TimYates
ID: 8070498
I had this too with JBoss 2.4...

I'm trying to remember what it was...
0
 
LVL 35

Expert Comment

by:TimYates
ID: 8070551
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
 

Author Comment

by:sunithas
ID: 8089796
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
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!

 

Author Comment

by:sunithas
ID: 8090722
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
 

Author Comment

by:sunithas
ID: 8101128
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
 
LVL 35

Accepted Solution

by:
TimYates earned 800 total points
ID: 8101724
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
 

Expert Comment

by:CleanupPing
ID: 9058917
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
This was posted to the Netbeans forum a Feb, 2010 and I also sent it to Verisign. Who didn't help much in my struggles to get my application signed. ------------------------- Start The idea here is to target your cell phones with the correct…
The viewer will learn how to implement Singleton Design Pattern in Java.
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses
Course of the Month11 days, 3 hours left to enroll

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question