cancel
Showing results for 
Search instead for 
Did you mean: 

Connection closed Error in Webdynpro - JDBC

Former Member
0 Kudos

Hi everybody !!

I have a WebDynpro Application that uses an Oracle database to display users. I'm using a Datasource configured in Visual Admin to connect WD and Database. Datasource properties are defaults properties.

My code to call the Datasource is:

public static Connection getConexionJDBC() throws JDBCException

{

Connection conn = null;

try

{

Context ctx = new InitialContext();

DataSource ds = (DataSource) ctx.lookup(ConnectionConstantsJDBC.DS_DEFAULT);

conn = ds.getConnection();

return conn;

}

catch (Exception e)

{

throw new JDBCException(ConnectionConstantsJDBC.MESS_ERROR_OPEN_CONN_JDBC + "(datasource por defecto)." + e.getMessage(), e);

}

}

The application runs ok all day, but when I get to work in the morning, the application return me that error. Connection closed.

To solve it, i have to restart de Datasource or the WAS Server, after of this, the application runs ok again, and so every day of the week. I've checked that the connections close OK when are completed using.

So, somebodu knows whats happening?

Thank you.

Fernando

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Check the exception and then try to open the new connection from the exception

Former Member
0 Kudos

Hi Fernado,

Currently i have done same implementation in an java code.But i am unable to call using component controller.

Please let me know how to call the java class by Controller.

Thanks

MG

Former Member
0 Kudos

Hi,

this code is included in my ejb project, you have to create an EJB Model in WEbdynpro to call it from Component Controller.

Regards,

Fernando

Former Member
0 Kudos

Looks like ur code is trying to connect to the existing connections. In case if there are no connections, see if you can open a new connection if there isn't any open connection.

Try this from ur catch block.

Former Member
0 Kudos

Hi,

try to invoke conn.close() or conn.destroy() statement.

Thanks,

nandini