Hi,
I went through our source code and it seems like we are closing all
connections.
The current code looks like this
try
{
conDBConnect = m_dsDataSource.getConnection();
// This prepared statement cannot be cached because we don't hold
// the connection all the time
pstmQuery = conDBConnect.prepareStatement(strStatement);
// Do something
}
catch (SQLException sqleExc)
{
Log.getInstance().error( "Failed to execute query. Original
message: "
+ sqleExc );
throw new EJBException( sqleExc );
}
finally
{
if (pstmQuery != null)
{
try
{
pstmQuery.close();
}
catch (SQLException sqleExc)
{
// Ignore this
Log.getInstance().warn("Proceeding although failed to close
the statement. Original message: "
+ sqleExc);
}
}
if (conDBConnect != null)
{
try
{
conDBConnect.close();
}
catch (SQLException sqleExc)
{
// Ignore this
Log.getInstance().warn("Proceeding although failed to close
the connection. Original message: "
+ sqleExc);
}
}
}
I'll try to put the connection closing to another finally of the query
closing, but that doesn't seem like an issue.
The problem is that I cannot consistently reproduce this, I found this
errors looking through 30MB log file for our server for several days. This
seems to be the sequence of events which has happened.
1. First we got message:
TransactionImpl.timeoutExpired: set rollback only 1018307595006675
TransactionImpl.timeoutExpired: Probable deadlock -> rollback
2001-07-06 12:39:59:109
TransactionImpl.timeoutExpired: set rollback only 1018307632447255
TransactionImpl.timeoutExpired: Probable deadlock -> rollback
<181>getICtx IT: transaction rolled back
<181>getICtx IT: no more transaction
preinvoke exception:
javax.transaction.TransactionRolledbackException: rollback occured while
waiting
System Exception in business method:javax.ejb.EJBException
Cannot set transaction as rollback only
<181>getICtx IT: transaction rolled back
<181>getICtx IT: no more transaction
preinvoke exception:
javax.transaction.TransactionRolledbackException: rollback occured while
waiting
System Exception in business method:javax.ejb.EJBException
Bad status=ROLLEDBACK
System Exception raised by request:
javax.ejb.EJBException
System Exception in business method:javax.ejb.EJBException
java.rmi.RemoteException: RuntimeException thrown by an enterprise
Bean; nested exception is:
javax.ejb.EJBException
javax.ejb.EJBException
at
com.compuware.cgf.beans.session.SessionTrackingControllerBean.login(SessionT
rackingControllerBean.java:224)
2. Then some time later we got message (with no other errors in between)
javax.transaction.SystemException: Cannot send XA
end:javax.transaction.xa.XAException
at
org.objectweb.jonas_tm.TransactionImpl.delistResource(TransactionImpl.java:2
01)
at org.objectweb.jonas_tm.Current.doDetach(Current.java:639)
at org.objectweb.jonas_tm.Current.commit(Current.java:202)
at
org.objectweb.jonas_ejb.container.JBean.postinvoke(JBean.java:182)
at
org.objectweb.jonas_ejb.container.JBeanSession.postinvoke(JBeanSession.java:
190)
at
org.objectweb.jonas_ejb.container.JBeanSessionSl.postinvoke(JBeanSessionSl.j
ava:166)
at
com.compuware.cgf.beans.user.JOnAScom_compuware_cgf_beans_user_UserControlle
rRemote.remove
(JOnAScom_compuware_cgf_beans_user_UserControllerRemote.java:992)3. and then
some time later we got message (with no other errors in between)
Cannot enlist XAResource:javax.transaction.SystemException: Cannot
send XA start:javax.transaction.xa.XAException: XA START: mixed transactions
Connection will not be enlisted in a transaction
java.sql.SQLException: Cannot enlist XAResource
System Exception in business method:javax.ejb.EJBException
System Exception in business method:javax.ejb.EJBException
System Exception raised by request:
javax.ejb.EJBException
XAResource ---> rollback: XA START without XA END
WARNING: Connection not closed by caller
System Exception in business method:javax.ejb.EJBException
java.rmi.RemoteException: RuntimeException thrown by an enterprise
Bean; nested exception is:
javax.ejb.EJBException
javax.ejb.EJBException
at
com.compuware.cgf.beans.session.SessionTrackingControllerBean.login
(SessionTrackingControllerBean.java:224)
Can you see any problem with our code or with the sequence of action
happened. Just one question, we get hold of data source in
setSessionContext() and then keep it and just use it to get connection when
we need it (and immidiately relase it)
Thanks,
Miro Halas
-----Original Message-----
From: Philippe Durieux [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 09, 2001 2:52 AM
To: Halas, Miroslav
Cc: [EMAIL PROTECTED]
Subject: Re: XA error
"Halas, Miroslav" wrote:
>
> Hi Jonas team,
>
> can you please explain what can cause error like this. Thanks a lot,
>
> Miro Halas
>
> Cannot enlist XAResource:javax.transaction.SystemException: Cannot send XA
> start:javax.transaction.xa.XAException: XA START: mixed transactions
> Connection will not be enlisted in a transaction
> java.sql.SQLException: Cannot enlist XAResource
> System Exception in business method:javax.ejb.EJBException
> System Exception in business method:javax.ejb.EJBException
> System Exception raised by request:
> javax.ejb.EJBException
> XAResource ---> rollback: XA START without XA END
> WARNING: Connection not closed by caller
It seems that you have opened a connection and you forgot to close it.
Jonas connection management works weel only if all connections are closed
by caller. This is requiered for the connection pool.
> System Exception in business method:javax.ejb.EJBException
> java.rmi.RemoteException: RuntimeException thrown by an enterprise Bean;
> nested exception is:
> javax.ejb.EJBException
> javax.ejb.EJBException
> at
>
com.compuware.cgf.beans.session.SessionTrackingControllerBean.login(SessionT
> rackingControllerBean.java:224)
> at
>
com.compuware.cgf.beans.session.JOnAScom_compuware_cgf_beans_session_Session
>
TrackingControllerRemote.login(JOnAScom_compuware_cgf_beans_session_SessionT
> rackingControllerRemote.java:37)
> at
>
com.compuware.cgf.servlets.session.LoginServlet.verifyLogin(LoginServlet.jav
> a:393)
> at
>
com.compuware.cgf.servlets.session.SessionServlet.service(SessionServlet.jav
> a:268)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> at
>
com.mortbay.HTTP.Handler.Servlet.ServletHolder.handle(ServletHolder.java:474
> )
> at
>
com.mortbay.HTTP.Handler.Servlet.ServletHandler.handle(ServletHandler.java:4
> 30)
> at
>
com.mortbay.HTTP.Handler.Servlet.ServletHandler.handle(ServletHandler.java:2
> 86)
> at
com.mortbay.HTTP.HandlerContext.handle(HandlerContext.java:1087)
> at com.mortbay.HTTP.HttpServer.service(HttpServer.java:662)
> at
com.mortbay.HTTP.HttpConnection.service(HttpConnection.java:457)
> at com.mortbay.HTTP.HttpConnection.handle(HttpConnection.java:317)
> at
> com.mortbay.HTTP.SocketListener.handleConnection(SocketListener.java:99)
> at com.mortbay.Util.ThreadedServer.handle(ThreadedServer.java:254)
> at
> com.mortbay.Util.ThreadPool$PoolThreadRunnable.run(ThreadPool.java:601)
> at java.lang.Thread.run(Thread.java:484)
> ----
> To unsubscribe, send email to [EMAIL PROTECTED] and
> include in the body of the message "unsubscribe jonas-users".
> For general help, send email to [EMAIL PROTECTED] and
> include in the body of the message "help".
--
Philippe Durieux ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Bull - 1 rue de Provence - 38432 Echirolles Cedex France
[EMAIL PROTECTED]
-> Download our EJBServer at http://www.evidian.com/ejb <-
----
To unsubscribe, send email to [EMAIL PROTECTED] and
include in the body of the message "unsubscribe jonas-users".
For general help, send email to [EMAIL PROTECTED] and
include in the body of the message "help".