jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stefan Guggisberg (JIRA)" <j...@apache.org>
Subject [jira] Commented: (JCR-1039) Bundle Persistence Manager error - failing to read bundle the first time
Date Mon, 06 Aug 2007 12:49:59 GMT

    [ https://issues.apache.org/jira/browse/JCR-1039?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12517919
] 

Stefan Guggisberg commented on JCR-1039:
----------------------------------------

by using christoph's test case i was able to reproduce the issue.
thanks, christoph!

synopsis:
**********
the issue is caused by the fact that while reading a blob from the resultset of a sql stmt
a second stmt is executed.
in autocommit mode resources bound to a resultset may be freed if another stmt is executed
on the same connection.

the problem occurs when the blob exceeds a certain size (i guess 64kb) in which case derby
seems to spool 
the blob to disk.

BundleBinding.readBundle()  consumes the passed stream (from the result set and indirectly
calls 
DbNameIndex.getString() which executes another sql stmt. 

stack trace:

java.io.IOException: ERROR 40XD0: Container has been closed
	at org.apache.derby.impl.store.raw.data.OverflowInputStream.fillByteHolder(Unknown Source)
	at org.apache.derby.impl.store.raw.data.BufferedByteHolderInputStream.read(Unknown Source)
	at java.io.DataInputStream.read(DataInputStream.java:224)
	at java.io.FilterInputStream.read(FilterInputStream.java:111)
	at org.apache.jackrabbit.core.persistence.bundle.util.TrackingInputStream.read(TrackingInputStream.java:118)
	at java.io.DataInputStream.read(DataInputStream.java:224)
	at org.apache.jackrabbit.core.persistence.bundle.util.BundleBinding.readPropertyEntry(BundleBinding.java:370)
	at org.apache.jackrabbit.core.persistence.bundle.util.BundleBinding.readBundle(BundleBinding.java:114)
	at org.apache.jackrabbit.core.persistence.bundle.BundleDbPersistenceManager.loadBundle(BundleDbPersistenceManager.java:891)
	at org.apache.jackrabbit.core.persistence.bundle.AbstractBundlePersistenceManager.getBundle(AbstractBundlePersistenceManager.java:663)
	at org.apache.jackrabbit.core.persistence.bundle.AbstractBundlePersistenceManager.exists(AbstractBundlePersistenceManager.java:488)
	at org.apache.jackrabbit.core.state.SharedItemStateManager.hasNonVirtualItemState(SharedItemStateManager.java:1108)
	at org.apache.jackrabbit.core.state.SharedItemStateManager.hasItemState(SharedItemStateManager.java:285)
	at org.apache.jackrabbit.core.state.LocalItemStateManager.hasItemState(LocalItemStateManager.java:180)
	at org.apache.jackrabbit.core.state.XAItemStateManager.hasItemState(XAItemStateManager.java:252)
	at org.apache.jackrabbit.core.state.SessionItemStateManager.getItemState(SessionItemStateManager.java:174)
	at org.apache.jackrabbit.core.ItemManager.createItemInstance(ItemManager.java:494)
	at org.apache.jackrabbit.core.ItemManager.getItem(ItemManager.java:325)
	at org.apache.jackrabbit.core.NodeImpl.getNode(NodeImpl.java:2428)
	at org.apache.jackrabbit.core.Test.main(Test.java:197)


possible solutions:
*********************
- buffer data read from stream before handling stream to BundleBinding
- set autocommit to false and commit explicitly at the end of 
   BundleDbPersistenceManager.loadBundle()
- read all name indices into hash maps on startup


> Bundle Persistence Manager error - failing to read bundle the first time
> ------------------------------------------------------------------------
>
>                 Key: JCR-1039
>                 URL: https://issues.apache.org/jira/browse/JCR-1039
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.3
>         Environment: Windows
>            Reporter: Sridhar
>         Attachments: jackrabbit-core-testcase.patch
>
>
> Code:
> NodeIterator entiter = null;
> Node root = null, contNode = null, entsNode = null;
> try
> {
>     root = session.getRootNode();
>     contNode = root.getNode("sr:cont");
>     entsNode = contNode.getNode("sr:ents");
>     entiter = entsNode.getNodes();
> }
> catch (Exception e)
> {
>     logger.error("Getting ents nodes", e);
> }
> Output:
> 12359 [http-8080-Processor24] ERROR org.apache.jackrabbit.core.persistence.bundle.BundleDbPersistenceManager
- failed to read bundle: c3a09c19-cc6b-45bd-a42e-c4c925b67d02: java.io.IOException: ERROR
40XD0: Container has been closed
> 12375 [http-8080-Processor24] ERROR com.taxila.editor.sm.RepoOperations - Getting ents
nodes
> javax.jcr.PathNotFoundException: sr:ents
>     at org.apache.jackrabbit.core.NodeImpl.getNode(NodeImpl.java:2435)
>     at com.taxila.editor.sm.RepoOperations.getEntityNodes (RepoOperations.java:4583)
>     at com.taxila.editor.sm.RepoOperations.displayEntities(RepoOperations.java:4159)
>     at com.taxila.editor.sm.RepoOperations.displayEntities(RepoOperations.java:4114)
>     at com.taxila.editor.em.um.MainEntityForm.reset (MainEntityForm.java:215)
>     at org.apache.struts.taglib.html.FormTag.doStartTag(FormTag.java:640)
>     at org.apache.jsp.pages.jsp.entity.MainEntity_jsp._jspService(MainEntity_jsp.java:414)
>     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:332)
>     at org.apache.jasper.servlet.JspServlet.serviceJspFile (JspServlet.java:314)
>     at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
>     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 org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java
:672)
>     at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
>     at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
>     at org.apache.catalina.core.ApplicationDispatcher.forward (ApplicationDispatcher.java:301)
>     at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1014)
>     at org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProcessor.java:417)
>     at org.apache.struts.action.RequestProcessor.processActionForward(RequestProcessor.java:390)
>     at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:271)
>     at org.apache.struts.action.ActionServlet.process (ActionServlet.java:1292)
>     at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:510)
>     at javax.servlet.http.HttpServlet.service(HttpServlet.java:709)
>     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 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.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
>     at org.apache.catalina.connector.CoyoteAdapter.service (CoyoteAdapter.java:148)
>     at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:869)
>     at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java
:664)
>     at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
>     at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:80)
>     at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run (ThreadPool.java:684)
>     at java.lang.Thread.run(Unknown Source)
> On the other hand if I do this:
> Code:
> try
> {
>     root = session.getRootNode ();
>     contNode = root.getNode("sr:cont");
>     entsNode = contNode.getNode("sr:ents");
>     entiter = entsNode.getNodes();
> }
> catch (Exception e)
> {
>     logger.error("Getting ents nodes", e);
>     try
>     {
>         entsNode = contNode.getNode("sr:ents");
>         entiter = entsNode.getNodes();
>     }
>     catch (Exception e1)
>     {
>         e1.printStackTrace();
>     }
> }
> Output:
> The first error as in the previous case comes, but the second execution of the entsNode
= contNode.getNode("sr:ents"); statement returns the right node, and hence the iterator.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message