This will also, of course, lead to better performance, period, in your case. Sounds to me like you need something like a WorkerQueue where you put requests in a regular queque and a thread pool of anonymous worker threads run a FIFO collection. This is fairly standard stuff with Doug Lea's stuff on concurrent programming (try "oswego doug lea" in google). If you are single threaded, you will not be able to consistent. And, if you are multi-threaded, in the model, then there are numerous things you can do, even if the WorkerPool (or whatever Doug calls it, I forget) is but one thread. You an return the thread while the database is doing its stuff. Why not? There are a lot of creative solutions, once you use concurrent techniques.

I hope this is helpful. If you don't need to return the results of the database, but just to update, then you can really make it hum, having the database stuff just in queque until the right time.

I do this with helper computers doing little tasks for me on modem based home computers (with the consent of friends). I just have them pass a notice of what there ip address is to a queque with a time, and when I need a little work done, I pass it via a tunnel to the freshest ip address, which is held at the application level. Of course, it is even easier with static ips. But, my friends, like me, don't have static ips.

We are POOR! LOL.

Micael

At 04:54 PM 8/11/2003 -0700, Micael wrote:
Have you thought about using a multi-threaded solution with a queque such that when your database is busy you can notify the user that things are being processed and giving them a link to check back on?

At 12:46 PM 8/11/2003 0500, Nathan Rogers wrote:
The request path for a standard action within my code goes something like this :
Struts servlet -> action -> model -> database -> model -> action -> Velocity servlet


Here's what I know about each issue you've brought up.

#1 - Tomcat is configured to work with the Warp connector. I don't know exactly how this works (if it passes all requests to Tomcat or just the ones registered to a servlet)

#2 - I'll have to check with the sysadmin. Where is the number of request processors defined?

#3 - I'm using the Jakarta Commons PoolingDataSource. I have used this before without any problems

#4 - Something to look into. I'm closing my result sets, statements and connections (which returns them to the pool), but it might not be done in the best way.

Mainguy, Mike wrote:

The closest I ever came to this sort of problem involved the following:
#1 Sending static content (and lots of it) through the servlet engine
instead of using the web server.
#2 Not having enough request processors and listeners configured.
#3 Not using pooling for my connections and killing the DBMS with new
connection requests.
#4 Not properly closing/releasing my DBMS connections and consuming all
available memory.
So there you go, everything you should NOT do in a nutshell.
Unless you're 100% proof-positive sure that it is a synchronization issue in
your database portion, I would take a look at the above issues as potential
problem areas.
As far as synchronization is concerned, the only thing I can recommend is to
be sure you aren't using your ActionServlet or something high in the food
chain as your target,  otherwise that would seem to cause that sort of a
problem.

-----Original Message-----
From: Nathan Rogers [mailto:[EMAIL PROTECTED] Sent: Monday, August 11, 2003 12:51 PM
To: [EMAIL PROTECTED]
Subject: Struts and synchronization
I am using Struts 1.1 along with the Velocity tools to develop a fairly simple servlet (there are probably going to be no more than twenty actions total)
The problem that I am facing is a deadlock situation where Tomcat simply refuses to respond to any new requests and just stalls. I think it may be due to some code in the model where I am using PreparedStatements (which are declared as synchronized). Has anyone else run into a similar problem where the Struts framework takes an unreasonably long time to handle a request due to synchronized methods? Is there any workaround, other than only using Statements in my model?


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

This message and its contents (to include attachments) are the property of Kmart Corporation (Kmart) and may contain confidential and proprietary information. You are hereby notified that any disclosure, copying, or distribution of this message, or the taking of any action based on information contained herein is strictly prohibited. Unauthorized use of information contained herein may subject you to civil and criminal prosecution and penalties. If you are not the intended recipient, you should delete this message immediately.


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]


--
Nathan Rogers
Library Technology Group
[EMAIL PROTECTED]
(608)261-1409


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



LEGAL NOTICE


This electronic mail transmission and any accompanying documents contain information belonging to the sender which may be confidential and legally privileged. This information is intended only for the use of the individual or entity to whom this electronic mail transmission was sent as indicated above. If you are not the intended recipient, any disclosure, copying, distribution, or action taken in reliance on the contents of the information contained in this transmission is strictly prohibited. If you have received this transmission in error, please delete the message. Thank you



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




LEGAL NOTICE


This electronic mail transmission and any accompanying documents contain information belonging to the sender which may be confidential and legally privileged. This information is intended only for the use of the individual or entity to whom this electronic mail transmission was sent as indicated above. If you are not the intended recipient, any disclosure, copying, distribution, or action taken in reliance on the contents of the information contained in this transmission is strictly prohibited. If you have received this transmission in error, please delete the message. Thank you



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to