Hi,

Without seeing your code, I can offer a 
supposition.  Sounds like you are
repeatedly accessing the same servlet from the
same browser by hitting refresh.  If so, it is 
possible that your servlet gets an IOException 
(`Connection reset by peer`) when trying to write 
to a closed socket.  I am guessing that the 
db.commit() in your code may not get called.
Try wrapping your servlet code in a "try ... 
finally" and call db.commit() in the finally.
Hope this helps.

-o


--- Carlos Illana <[EMAIL PROTECTED]> wrote:
> I have written a simple JSP that all occurences in
> the DB of a type of 
> object, but when this JSP is accessed concurrently
> (for instance with a 
> reload of the page before it is totally served)
> Castor complains with 
> following exception.
> 
> How can I solve this problem? Should db.begin()
> block if there is a 
> transaction in progress? Ask if there is a
> transaction with 
> db.active()???
> 
> Thanx,
>       Carlos
> 
> org.exolab.castor.jdo.PersistenceException: This
> thread is already 
> associated with a transaction in progress
>         at 
>
org.exolab.castor.jdo.PersistenceException.<init>(PersistenceException.j
> ava:79)
>         at 
>
org.exolab.castor.jdo.engine.DatabaseImpl.begin(DatabaseImpl.java:477)
>         at 
>
_0002fall_0005fpapers_0002ejspall_0005fpapers_jsp_0._jspService(_0002fal
>
l_0005fpapers_0002ejspall_0005fpapers_jsp_0.java:115)
>         at 
>
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:119)
>         at
>
javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>         at 
>
org.apache.jasper.servlet.JspServlet$JspCountedServlet.service(JspServle
> t.java:130)
>         at
>
javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>         at 
>
org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServle
> t.java:282)
>         at 
>
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:429)
>         at 
>
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:500)
>         at
>
javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
>         at 
>
org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)
>         at
>
org.apache.tomcat.core.Handler.service(Handler.java:287)
>         at 
>
org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
>         at 
>
org.apache.tomcat.core.ContextManager.internalService(ContextManager.jav
> a:797)
>         at 
>
org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
>         at 
>
org.apache.tomcat.service.connector.Ajp12ConnectionHandler.processConnec
> tion(Ajp12ConnectionHandler.java:166)
>         at 
>
org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
>         at 
>
org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:50
> 1)
>         at java.lang.Thread.run(Thread.java:498)
> 
>
-----------------------------------------------------------
> 
> If you wish to unsubscribe from this mailing, send
> mail to
> [EMAIL PROTECTED] with a subject of:
>       unsubscribe castor-dev
> 


__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to