On Tue, May 15, 2001 at 03:06:42PM -0700, <enter name here> wrote:
> OK. You asked for it.
> 
> I will try to make this as clean and readable as possible:
> 
> 1) jboss.jcml entries
> 2) connection creation
> 3) static methods for closing Connections/Statements and Results Sets
> 4) Stack Trace of rmi Error when calling the static methods
> 5) Stack Trace of NullPointerException on closing of PreparedStatement
> 
> 1) *** JBOSS.JCML:

Looks fine.

> 2) *** CONNECTION CREATION
>    InitialContext jndiContext = new InitialContext();
>    XAPoolDataSource ds = (XAPoolDataSource)
> jndiContext.lookup("java:/OracleDS");
>    Connection conn = ds.getConnection();

Don't reference Minerva classes in your code.  Just use javax.sql.DataSource.

Also, you should use java:comp/env/ lookups, but that's not relevent here.

> 3) *** static methods for closing rs/conn/stmt  ( I will place the entire
> class here -- sorry if the readability is a little bad, tried to crunch it
> all in )
> import java.sql.*;
> public class DatabaseUtility {

Looks fine.

> 4) *** RMI ServerException Stack Trace ( this is thrown and the connection
> is NOT returned to the pool )
>     This is thrown when I try to call DatabaseUtility.closeConnection(
> connection ); (notice I catch _everything_ in that method) and is _not_
> thrown in the DatabaseUtility, but seems like it is thrown on the attempt to
> call the method.
> java.rmi.ServerException: Transaction rolled
> back:com/bebee/recommender/utility/DatabaseUtility
>       at org.jboss.ejb.plugins.TxInterceptorBMT.invoke(TxInterceptorBMT.java:300)

Ok, you're missing out some details.  Are you calling an EJB from a servlet?

You haven't mentioned anything about what this EJB is doing.  What are you
doing with transactions?  Are you getting the connection in the servlet
and trying to close it from the EJB or something?

> 5) *** NullPointerException stack trace (sorry for the log format) this is
> thrown on the preparedStatement.close() call inside the bean at the end of
> the transaction (which is directly after the call to connection.close() --
> when I change the order of the calls, i.e. first close the prepared
> statement then close the connection it works fine)

This is a bug.  I'll look at this kind of fragility at some point.

Toby.

_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to