Re: FaultFailureException

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Thu Jun 22 2006 - 11:12:53 EDT

  • Next message: Andrus Adamchik: "Re: FaultFailureException"

    Yeah, I have your DataMap file. I'll investigate what's going on.

    Andrus

    On Jun 22, 2006, at 6:47 PM, Lothar Krenzien wrote:

    > Hi,
    >
    > I have a web app with struts and get very often a
    > FaultFailureException in cayenne (RC1). Either with the text
    > "state=hollow" or "state=transient". It happens often after editing
    > some data in the frontend, save and commit it and try to load the
    > previous saved data. And when the error occurs I get some other
    > exceptions on nearly every database access. To 'solve' the problem
    > I have to logout - so that the session will be destroyed and login
    > again (with a new session). Now I can see all my changes - so I'm
    > sure that all changes were committed. What could I'm doing wrong ?
    >
    > 2006-06-22 10:57:45,097 [ERROR]
    > EditPlantConfigAction.com.sunreader.sr2.struts.actions.portal.EditPlan
    > tConfigAction.throwSystemException: >
    > org.objectstyle.cayenne.FaultFailureException: [v.1.2RC1 May 31
    > 2006] Error resolving fault for ObjectId:
    > <ObjectId:TblPartnerpersonId=498> and state (hollow). Possible
    > cause - matching row is missing from the database.
    > at org.objectstyle.cayenne.access.DataContext.prepareForAccess
    > (DataContext.java:1851)
    > at org.objectstyle.cayenne.CayenneDataObject.readProperty
    > (CayenneDataObject.java:238)
    > at com.sunreader.sr2.back.auto._TblPartner.getName
    > (_TblPartner.java:31)
    > at com.sunreader.sr2.back.util.MapperHelper.partnerToBo
    > (MapperHelper.java:314)
    > at com.sunreader.sr2.back.dao.UserDAO.setAccountPersonData
    > (UserDAO.java:118)
    > at com.sunreader.sr2.back.dao.UserDAO.getUser(UserDAO.java:100)
    > at com.sunreader.sr2.back.dao.UserDAO.getUserAccount(UserDAO.java:
    > 143)
    > at com.sunreader.sr2.back.proxy.CayenneProxy.getUserAccount
    > (CayenneProxy.java:105)
    > at com.sunreader.sr2.back.BusinessFacade.getUserAccount
    > (BusinessFacade.java:91)
    > at
    > com.sunreader.sr2.struts.actions.portal.EditPlantConfigAction.doExecut
    > e(EditPlantConfigAction.java:34)
    > at com.sunreader.base.struts.BasicAction.execute(BasicAction.java:
    > 259)
    > at org.apache.struts.action.RequestProcessor.processActionPerform
    > (RequestProcessor.java:419)
    > at org.apache.struts.action.RequestProcessor.process
    > (RequestProcessor.java:224)
    > at org.apache.struts.action.ActionServlet.process
    > (ActionServlet.java:1196)
    > at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:
    > 414)
    > at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
    > 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.sunreader.sr2.filter.MandantSessionFilter.doFilter
    > (MandantSessionFilter.java:63)
    > 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:213)
    > 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.FastCommonAccessLogValve.invoke
    > (FastCommonAccessLogValve.java:495)
    > at org.apache.catalina.core.StandardEngineValve.invoke
    > (StandardEngineValve.java:107)
    > at org.apache.catalina.connector.CoyoteAdapter.service
    > (CoyoteAdapter.java:148)
    > at org.apache.jk.server.JkCoyoteHandler.invoke
    > (JkCoyoteHandler.java:199)
    > at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:
    > 282)
    > at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:754)
    > at org.apache.jk.common.ChannelSocket.processConnection
    > (ChannelSocket.java:684)
    > at org.apache.jk.common.ChannelSocket$SocketConnection.runIt
    > (ChannelSocket.java:876)
    > at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run
    > (ThreadPool.java:684)
    > at java.lang.Thread.run(Unknown Source)
    >
    >
    > 2006-06-22 15:46:16,242 [ERROR]
    > EditPlantConfigAction.com.sunreader.sr2.struts.actions.portal.EditPlan
    > tConfigAction.throwSystemException: >
    > org.objectstyle.cayenne.FaultFailureException: [v.1.2RC1 May 31
    > 2006] Error resolving fault for ObjectId:
    > <ObjectId:TblPartnerpersonId=208> and state (transient). Possible
    > cause - matching row is missing from the database.
    > at org.objectstyle.cayenne.access.DataContext.prepareForAccess
    > (DataContext.java:1851)
    > at org.objectstyle.cayenne.CayenneDataObject.readProperty
    > (CayenneDataObject.java:238)
    > at com.sunreader.sr2.back.auto._TblPartner.getName
    > (_TblPartner.java:31)
    > at com.sunreader.sr2.back.util.MapperHelper.partnerToBo
    > (MapperHelper.java:314)
    > at com.sunreader.sr2.back.dao.UserDAO.setAccountPersonData
    > (UserDAO.java:118)
    > at com.sunreader.sr2.back.dao.UserDAO.getUser(UserDAO.java:100)
    > at com.sunreader.sr2.back.dao.UserDAO.getUserAccount(UserDAO.java:
    > 143)
    > at com.sunreader.sr2.back.proxy.CayenneProxy.getUserAccount
    > (CayenneProxy.java:105)
    > at com.sunreader.sr2.back.BusinessFacade.getUserAccount
    > (BusinessFacade.java:91)
    > at
    > com.sunreader.sr2.struts.actions.portal.EditPlantConfigAction.doExecut
    > e(EditPlantConfigAction.java:34)
    > at com.sunreader.base.struts.BasicAction.execute(BasicAction.java:
    > 259)
    > at org.apache.struts.action.RequestProcessor.processActionPerform
    > (RequestProcessor.java:419)
    > at org.apache.struts.action.RequestProcessor.process
    > (RequestProcessor.java:224)
    > at org.apache.struts.action.ActionServlet.process
    > (ActionServlet.java:1196)
    > at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:
    > 414)
    > at javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
    > 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.sunreader.sr2.filter.MandantSessionFilter.doFilter
    > (MandantSessionFilter.java:63)
    > 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:213)
    > 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.FastCommonAccessLogValve.invoke
    > (FastCommonAccessLogValve.java:495)
    > at org.apache.catalina.core.StandardEngineValve.invoke
    > (StandardEngineValve.java:107)
    > at org.apache.catalina.connector.CoyoteAdapter.service
    > (CoyoteAdapter.java:148)
    > at org.apache.jk.server.JkCoyoteHandler.invoke
    > (JkCoyoteHandler.java:199)
    > at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:
    > 282)
    > at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:754)
    > at org.apache.jk.common.ChannelSocket.processConnection
    > (ChannelSocket.java:684)
    > at org.apache.jk.common.ChannelSocket$SocketConnection.runIt
    > (ChannelSocket.java:876)
    > at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run
    > (ThreadPool.java:684)
    > at java.lang.Thread.run(Unknown Source)
    >
    >
    > The error happens mostly when cayenne tries to resolve the relation
    > tblPerson -> tblPartner. It's an 1:1 relation but the relation can
    > be null. It means that a person can have a 'Partner' but don't need
    > it (the key column in tblPerson.partnerId can be null). What I saw
    > is - when the partnerId is null I get the "state=transient"
    > exception and when the partnerId is not empty I get the
    > "state=hollow" exception. The 'partner'-dataset was created
    > previously and can't changed anymore. The application gets the
    > tblPerson object with a standard query (but needs first an account
    > object) :
    >
    > DataContext context = getDaoContext(ctx);
    > TblAccount account;
    > Expression expr = ExpressionFactory.matchExp("loginName", loginname);
    > List<TblAccount> accountList = context.performQuery(new SelectQuery
    > (TblAccount.class, expr));
    > return accountList (0);
    >
    >
    > and then :
    >
    > if (account.getTblPerson().getTblPartner() != null) {
    > TblPartner partner = account.getTblPerson().getTblPartner();
    > partner.getName() ; <----- here the exception happens
    > }
    > else {
    > ...
    > }
    >
    > What makes me wonder is - even if a person don't have a partner the
    > condition is executed.
    > Additionally I have a background thread that starts every 15
    > minutes and executes a lot (!) of selects and inserts. Could that
    > have any influence ?
    >
    > I would be very gratefull for every hint. If it helps - we use
    > MSSQL 2000 and jtds
    > Lothar
    >
    > To Andrus:
    > I wrote you directly a mail at your private address about the NPE
    > in LRUMap. Maybe you can check it and give me an answer.
    >



    This archive was generated by hypermail 2.0.0 : Thu Jun 22 2006 - 11:13:18 EDT