Incidently, if the code were:
| Connection c; // no initalizer
| try
| {
|c = allocateConnection();
| }
| catch (SQLException e)
| {
| }
| finally
| {
|c.close();
| }
|
Most good compilers will fail to compile it, because it will tell you that
c could be uninit
"arparikh" wrote :
| Below is the code where we call getConnection to the connection object. We
are getting NullPointer where we do conn.close(). The thing that I am wondering
is if we are getting null conn, we should get null pointer at
conn.setAutoCommit in getConnection or conn.createState
Here is the code snippets.
Below is the getConnection which returns Connection object
public void init(String resourceId, String resourceName, boolean
defaultResource) throws DBException {
try {
Context initCtx = new InitialContext();
Context envCtx = (Context) initCtx.l
Post the code where you are doing this connection handling.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4018568#4018568
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4018568
__
Thats what i thought
We had issue where conn.close was throwing null pointer exception. I know
getConnection (our method which gets Connection from datasource) is returning
the Connection object because before it returns connection object, it does
conn.setAutoCommit(true).
The caller method o
No.
The idle-timeout is used to evaluate connections in the pool, not connections
in use. The element
| integer value of seconds
|
allows you to set a timeout on the query itself.
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4018517#4018517
Rep