--- Ralf Joachim <[EMAIL PROTECTED]> wrote:
> 2) Very commen is that after failures in an transaction (e.g. an
> exception), rollback is not called on the transaction. This causes
> castor to hold this locks forever.
That was the first thing I checked. Every single time a db.begin() gets
called there is a corresponding call to closeJDODatabase, which does:
public static void closeJDODatabase(Database db) {
try {
//rollback transaction
if it has
not been committed
if (db != null && db.isActive()) {
db.rollback();
}
if (db != null && !db.isClosed()) {
db.close();
}
db = null;
} catch (Exception fe) {
log.debug("", fe);
}
}
> 3) Also commen is that you access data through castor with multiple
> threads (e.g. at a web application with lots of users). If you always
> use default access mode, which is shared, one thread that loaded an
> object will block all other threads that also want to access the same
> object in shared access. An indication that you are hit by this is
> that
> the problem do not occure if only a small number of users are working
> with your application.
>
> I suggest you to first review your code if you are hit by the problem
> described at 2). If you are sure that this is not the problem you
> should
> try to read:
>
> http://docs.codehaus.org/display/CASTOR/Best+practis+to+use+CastorJDO
>
> This document is only a collection of comments copied together from a
> thread on mailling list but should give you some hints for
> optimizations
> to avoid the locking problem.
Thanks for this link Ralf I will review it thouroughly.
It is interesting to note though that this site has been live for some
time, but this problem only showed up recently. The load on the server
does not appear to have increased and no new code was deployed. That is
what led me to suspect server-database communication as the problem.
> Ralf
>
>
> Werner Guttmann schrieb:
> > August,
> >
> > yes, it seems like Castor JDO is trying to acquire locks all over
> the place. Can you share some information on how you are trying to
> use Castor ? And most importantly, what version of Castor are you
> using ? On what OS ? What database system ? Etc.
> >
> > Werner
> >
> > PS You could try to set a timeout and see whether this resolves
> your problem. Or at the minimum, you'll propably see
> LockNotGrantedExceptions after the timeout period you specified.
> >
> > -----Ursprüngliche Nachricht-----
> > Von: August Detlefsen [mailto:[EMAIL PROTECTED]
> > Gesendet: Montag, 29. August 2005 19:41
> > An: [email protected]
> > Betreff: [castor-dev] ObjectLock.acquireLoadLock using up all
> threads?
> >
> >
> > I've been seeing my server fail many times over the past few days
> and
> > when it does the thread dump is always full of these stack traces
> (like
> > every single processor thread).
> >
> > I read them to mean that Castor is waiting on database resources.
> Is
> > that correct? Can anyone shed some light as to what is happening
> here?
> >
> > Thanks,
> > August
> >
> >
> > "http-80-Processor15" daemon prio=10 tid=0x08869b50 nid=0x19 in
> > Object.wait() [0x71467000..0x71468cb8]
> > at java.lang.Object.wait(Native Method)
> > at java.lang.Object.wait(Object.java:474)
> > at
> >
>
org.exolab.castor.persist.ObjectLock.acquireLoadLock(ObjectLock.java:385)
> > - locked <0x7f7549e8> (a
> org.exolab.castor.persist.ObjectLock)
> > at
> >
>
org.exolab.castor.persist.LockEngine$TypeInfo.acquire(LockEngine.java:1252)
> > at
> >
>
org.exolab.castor.persist.LockEngine$TypeInfo.access$300(LockEngine.java:1055)
> > at
> > org.exolab.castor.persist.LockEngine.load(LockEngine.java:357)
> > at
> >
>
org.exolab.castor.persist.TransactionContext.load(TransactionContext.java:698)
> > - locked <0x7fa77578> (a
> > org.exolab.castor.jdo.engine.TransactionContextImpl)
> > at
> >
>
org.exolab.castor.persist.TransactionContext.load(TransactionContext.java:604)
> > - locked <0x7fa77578> (a
> > org.exolab.castor.jdo.engine.TransactionContextImpl)
> > at
> > org.exolab.castor.persist.ClassMolder.load(ClassMolder.java:810)
> > at
> > org.exolab.castor.persist.LockEngine.load(LockEngine.java:361)
> > at
> >
>
org.exolab.castor.persist.TransactionContext.load(TransactionContext.java:698)
> > - locked <0x7fa77578> (a
> > org.exolab.castor.jdo.engine.TransactionContextImpl)
> > at
> >
>
org.exolab.castor.persist.TransactionContext.load(TransactionContext.java:604)
> > - locked <0x7fa77578> (a
> > org.exolab.castor.jdo.engine.TransactionContextImpl)
> > at
> > org.exolab.castor.persist.ClassMolder.load(ClassMolder.java:810)
> > at
> > org.exolab.castor.persist.LockEngine.load(LockEngine.java:361)
> > at
> >
>
org.exolab.castor.persist.TransactionContext.load(TransactionContext.java:698)
> > - locked <0x7fa77578> (a
> > org.exolab.castor.jdo.engine.TransactionContextImpl)
> > at
> >
>
org.exolab.castor.persist.TransactionContext.load(TransactionContext.java:604)
> > - locked <0x7fa77578> (a
> > org.exolab.castor.jdo.engine.TransactionContextImpl)
> > at
> > org.exolab.castor.persist.ClassMolder.load(ClassMolder.java:810)
> > at
> > org.exolab.castor.persist.LockEngine.load(LockEngine.java:361)
> > at
> >
>
org.exolab.castor.persist.TransactionContext.load(TransactionContext.java:698)
> > - locked <0x7fa77578> (a
> > org.exolab.castor.jdo.engine.TransactionContextImpl)
> > at
> >
>
org.exolab.castor.persist.TransactionContext.load(TransactionContext.java:604)
> > - locked <0x7fa77578> (a
> > org.exolab.castor.jdo.engine.TransactionContextImpl)
> > at
> >
> org.exolab.castor.jdo.engine.DatabaseImpl.load(DatabaseImpl.java:316)
> > at
> >
> org.exolab.castor.jdo.engine.DatabaseImpl.load(DatabaseImpl.java:329)
> > at
> >
>
com.mycompany.servlets.content.PageController.getNavPage(PageController.java:835)
> > at
> > org.apache.jsp.index_jsp._jspService(org.apache.jsp.index_jsp:139)
> > at
> > org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
> > at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
> > at
> >
>
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:322)
> > at
> >
>
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:291)
> > at
> > org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
> > at
> javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
> > at
> >
>
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
> > at
> >
>
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
> > at com.mycompany.SSOFilter.doFilter(SSOFilter.java:187)
> > at
> >
>
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
> > at
> >
>
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
> > at
> >
>
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:204)
> > at
> >
>
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
> > at
> >
>
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
> > at
> >
>
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
> > at
> >
>
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:526)
> > at
> >
>
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
> > at
> >
>
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
>
=== message truncated ===
-------------------------------------------------
If you wish to unsubscribe from this list, please
send an empty message to the following address:
[EMAIL PROTECTED]
-------------------------------------------------