aspose file tools*
The moose likes Servlets and the fly likes Critical Please advice Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Critical Please advice" Watch "Critical Please advice" New topic
Author

Critical Please advice

peter brews
Greenhorn

Joined: Feb 11, 2002
Posts: 20
We have a application running on Weblogic. We have developed a Java class which gets a connection from the connection pool and have methods to get Statemet Objects on the connection. from the client code example: JSP we instansiate this class to get the Connection object and the Statement object and execute queries.
There seems to be a potential problem in the sense that there is Statment Contention. Exampele : 2 Statement Objects A & B are getting executed Statment B completes its operations but A is still open when we call the closeStatement method on Statement object B it seems to be closing Statemnt A which causes a lot of problems.

Could you please advice
Byron Estes
Ranch Hand

Joined: Feb 21, 2002
Posts: 313
Consider posting the code. Without it we'd just be guessing...


Byron Estes<br />Sun Certified Enterprise Architect<br />Senior Consulant<br />Blackwell Consulting Services<br />Chicago, IL<br /><a href="http://www.bcsinc.com" target="_blank" rel="nofollow">www.bcsinc.com</a>
Craig Jackson
Ranch Hand

Joined: Mar 19, 2002
Posts: 405
I am not quite sure, this is the type of response you are looking for, but like Byron stated above, some code would help, but I will take a guess.
My suggestion would be is that you create a Data Access Object which handles all of the access to the database internally, i.e. connection, statement. This particular bean would reside in session scope or maybe application scope.
I would expose certain service methods such as for example query(String str), update(Object obj)
add, delete, you get the idea. Something similar to, I guess a stateless bean. The methods acquire and release resources during a method call.
The key point is that the methods acquire and release resources during a method call.
Like a said, I am not sure if this will help or not. Maybe some code will shed more light.

Craig.
 
Consider Paul's rocket mass heater.
 
subject: Critical Please advice
 
Similar Threads
Method design advice
Using one connection object between multiple threads
servlets and inheritance
Critical Please Advice
PreparedStatement with Connection Pooling