Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"cursor with hold" / "cursor without hold"

Status
Not open for further replies.

Ruvera

Programmer
May 8, 2002
12
RU
Hi, i have been trying to write an java application (with prepared statements) on win2000. How can I set the "cursor with hold" / "cursor without hold" in the java (1.4) code ?

 
Hi Ruvera,
You're going to have to be more specific for us to help. What do you mean by "cursor with hold" / "cursor without hold"?
MarChelios
 
In a high volume transaction environment I have a servlet
read/write operations on a database for each time that it is called. When using a low transaction rate everything works just fine. However, when stressing the system DB2 comes back with the following message:
IBM][CLI Driver] CLI0129E No more handles. SQLSTATE=HY014.

I think, I should CURSOR WITH HOLD (which is the default) change this to CURSOR WITHOUT HOLD.

How can I resolve this problem?
 
Ruvera,
You still have not adequately descibed what a "cursor with hold" / "cursor without hold" is. What is it, what does it look like, what is used for in other programs, etc. I have never heard of it before and apparently from the lack of posts neither has anyone else. Describe your problem and then we can help.
MarsChelios
 
Since you mentioned that you are using servlets, it looks like a Web application form, is it ?
Servlets are run under a J2EE application server
(Tomcat, JRun, WebLogic, WebSphere, etc.).

I have experience with WebLogic. Commonly a proper
technique is to use database connection pools
(rather than open a connection each time you get
a request). So you application server opens several
connections (in advance; when you configure
WebLogic server you can specify the initial number
of connections, the increment and the maximum
number of connections in the pool).

Whenever you nee to deal with the database in
your servlet, you request a connection from the pool
(of available connections), do your job and
once you are done, you have to return your connection back
to the pool, which you do by applying the close()
method to your connection.

Keep in mind, if you are getting a java.sql.Connection
object from the J2EE server connection pool its close()
method does not close the connection, it just marks it as
available for grabs from the pool.

This could be one of the potential causes of your problem.

I'd also recommend you to close your ResultSet objects
once you do not need them.

Provide more details on your environment,
may be we will be able to assist you better.




 
As far as your query.... it seems that you are asking for some help basically on the database end....

Please specify if you are trying to use cursor functions from middle tier and not from the backend (database).

Sudeep
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top