cancel
Showing results for 
Search instead for 
Did you mean: 

Automatic check of connection DB

Former Member
0 Kudos

Hi,

I'm developing a web service that gets the data from a database using a data source (connection pool).

The environment is:

SAP NetWeaver Developer Studio

Version: 7.0.10

Build id: 200610212349

When something is wrong with the database and it's necessary to restart the database instance, the web service return an exception: "connection reset by peer". To fix it, we have to restart the connection pool. In some application servers, like BEA, the application server in a transparent way checks if the connection is valid before giving to the client and if it´s not valid, create one. It´s possible to do this with SAP WAS?

Best regards.

Raul.

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Raul,

There's not really a big different between SAP J2EE AS an any other J2EE engines around (except transaction locking, J2EE version). Maybe you've to review your coding if the connections are closed when they have to, or increase the connections of the pool / datasource. In standard SAP J2E AS behaves like any other J2E AS around.

Regards,

Daniel

Former Member
0 Kudos

Hi,

Thank for your answers. I think that my program must not be the responsible to check if the a connection is closed or not. For me, the Application Server is the responsible to check the status of the connection and return if the connection is closed, a new one, transparently; for example, in BEA 8.1 when you define a connection pool there is a parameter called "Test Connections On Reserve": enables WebLogic Server to test a connection before giving it to a client. (Requires that you specify a Test Table Name.)

The test adds a small delay in serving the client's request for a connection from the pool, but ensures that the client receives a viable connection.

http://edocs.bea.com/wls/docs92/ConsoleHelp/pagehelp/JDBCjdbcdatasourcesjdbcdatasourceconfigconnecti...

Regards.

Raul.

former_member698570
Active Participant
0 Kudos

Hi,

are you using a JNDI Datasource?

You see the Datasources in the JDBC Connector Service.

If you don't have a Datasource try to create one for your application. When you have a problem with your database you could restart the database and then restart the Datasource. In your application you could initiate a new JNDI lookup. If the datasource is available the connection should be available too

Is this an option?

Cheers