on 06-20-2011 4:29 PM
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
Check the exception and then try to open the new connection from the exception
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
9 | |
8 | |
6 | |
6 | |
6 | |
5 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.