Hibernate problem since using federation connector
sjahan Aug 8, 2011 5:59 AMHi everyone,
I didn't try to debug it deeply yet, prefering starting a thread if someone already experienced that, it could be faster to do this way.
Here's the case:
We got a Jpa connector which works fine.
We wanna keep the Jpa connector and add a SVN connector, setting both connectors using the federation one.
I set my configuration file to get this config, i assume this is right, at least for the Jpa part (SVN will be another part to deal with later), but the Jpa part doesn't work anymore and i don't know why. This seems to be ok at the beggining since i get some hibernate stuff but a weird problem happens.
I get as usual some hibernate trace and it freezes til the timeout.
Here is the stacktrace i finally get:
...
11:33:43,631 INFO [STDOUT] Hibernate:
/* insert org.modeshape.connector.store.jpa.model.simple.SubgraphQueryEntity
*/ insert
into
MODE_SUBGRAPH_QUERIES
(ROOT_UUID, WORKSPACE_ID)
values
(?, ?)
11:33:43,632 INFO [STDOUT] Hibernate:
/* insert org.modeshape.connector.store.jpa.model.simple.SubgraphNodeEntity
*/ insert
into
MODE_SUBGRAPH_NODES
(DEPTH, CHILD_NUM, UUID, PARENT_NUM, QUERY_ID)
values
(?, ?, ?, ?, ?)
11:34:34,087 WARN [JDBCExceptionReporter] SQL Error: 1205, SQLState: 41000
11:34:34,087 ERROR [JDBCExceptionReporter] Lock wait timeout exceeded; try restarting transaction
11:34:34,090 ERROR [AssertionFailure] an assertion failure occured (this may indicate a bug in Hibernate, but is more likely due to unsafe use of the session)
org.hibernate.AssertionFailure: null id in org.modeshape.connector.store.jpa.model.simple.SubgraphNodeEntity entry (don't flush the Session after an exception occurs)
at org.hibernate.event.def.DefaultFlushEntityEventListener.checkId(DefaultFlushEntityEventListener.java:78)
at org.hibernate.event.def.DefaultFlushEntityEventListener.getValues(DefaultFlushEntityEventListener.java:187)
at org.hibernate.event.def.DefaultFlushEntityEventListener.onFlushEntity(DefaultFlushEntityEventListener.java:143)
at org.hibernate.event.def.AbstractFlushingEventListener.flushEntities(AbstractFlushingEventListener.java:219)
at org.hibernate.event.def.AbstractFlushingEventListener.flushEverythingToExecutions(AbstractFlushingEventListener.java:99)
at org.hibernate.event.def.DefaultAutoFlushEventListener.onAutoFlush(DefaultAutoFlushEventListener.java:58)
at org.hibernate.impl.SessionImpl.autoFlushIfRequired(SessionImpl.java:996)
at org.hibernate.impl.SessionImpl.executeUpdate(SessionImpl.java:1163)
at org.hibernate.impl.QueryImpl.executeUpdate(QueryImpl.java:117)
at org.hibernate.ejb.QueryImpl.executeUpdate(QueryImpl.java:51)
at org.modeshape.connector.store.jpa.model.simple.SubgraphQuery.create(SubgraphQuery.java:95)
at org.modeshape.connector.store.jpa.model.simple.SimpleJpaRepository$Workspace.getBranch(SimpleJpaRepository.java:500)
at org.modeshape.connector.store.jpa.model.simple.SimpleRequestProcessor.process(SimpleRequestProcessor.java:63)
at org.modeshape.graph.request.processor.RequestProcessor.process(RequestProcessor.java:291)
at org.modeshape.connector.store.jpa.model.simple.SimpleJpaConnection.execute(SimpleJpaConnection.java:133)
at org.modeshape.graph.connector.RepositoryConnectionPool$ConnectionWrapper.execute(RepositoryConnectionPool.java:1129)
at org.modeshape.graph.Graph.execute(Graph.java:288)
at org.modeshape.graph.Graph$5.process(Graph.java:231)
at org.modeshape.graph.request.RequestBuilder.readBranch(RequestBuilder.java:214)
at org.modeshape.graph.Graph$27.at(Graph.java:2557)
at org.modeshape.graph.Graph$27.at(Graph.java:2565)
at org.modeshape.graph.Graph$27.at(Graph.java:2555)
at org.modeshape.graph.property.basic.GraphNamespaceRegistry.initializeCacheFromStore(GraphNamespaceRegistry.java:268)
at org.modeshape.graph.property.basic.GraphNamespaceRegistry.<init>(GraphNamespaceRegistry.java:92)
at org.modeshape.jcr.JcrRepository.<init>(JcrRepository.java:767)
at org.modeshape.jcr.JcrEngine.doCreateJcrRepository(JcrEngine.java:484)
at org.modeshape.jcr.JcrEngine.getRepository(JcrEngine.java:298)
at org.oea.jcr.storage.AbstractStorage.getRepository(AbstractStorage.java:57) //Our stuff
at org.oea.jcr.storage.AbstractStorage.login(AbstractStorage.java:64) //Our stuff
Here is the configuration file we use:
<?xml version="1.0" encoding="UTF-8"?> <configuration xmlns:mode="http://www.modeshape.org/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"> <mode:sources jcr:primaryType="nt:unstructured"> <!-- Portal source --> <mode:source jcr:name="Portal" mode:classname="org.modeshape.connector.store.jpa.JpaSource" mode:dataSourceJndiName="java:OEAPortal" mode:dialect="org.hibernate.dialect.MySQL5InnoDBDialect" mode:model="Simple" mode:maximumConnectionsInPool="1" mode:largeValueSizeInBytes="10000" mode:retryLimit="3" mode:compressData="false" mode:showSql="true" mode:autoGenerateSchema="validate" mode:creatingWorkspacesAllowed="true" mode:defaultWorkspaceName="workspace"> <mode:predefinedWorkspaceNames>system</mode:predefinedWorkspaceNames> <mode:predefinedWorkspaceNames>workspace</mode:predefinedWorkspaceNames> </mode:source> <mode:source jcr:name="SVN Store" mode:classname="org.modeshape.connector.svn.SvnRepositorySource" mode:description="The ModeShape SVN repository (anonymous access)" mode:repositoryRootUrl="https://svn.fr/svn/pa/trunk/OEA-SVN" mode:defaultWorkspaceName="workspace" username="sebastien.jahan" password="*******" > <mode:predefinedWorkspaceNames>workspace</mode:predefinedWorkspaceNames> <!-- If desired, specify a cache policy that caches items in memory for 5 minutes (300000 ms). This fragment can be left out if the connector should not cache any content.--> <mode:cachePolicy jcr:name="cachePolicy" mode:classname="org.modeshape.graph.connector.path.cache.InMemoryWorkspaceCache$InMemoryCachePolicy" mode:timeToLiveInMilliseconds="300000" /> </mode:source> <mode:source jcr:name="OEA"> <mode:classname>org.modeshape.graph.connector.federation.FederatedRepositorySource</mode:classname> <mode:workspaces> <mode:workspace jcr:name="workspace"> <mode:projections> <mode:projection jcr:name="MySQL portal repository projection" mode:source="Portal" mode:workspaceName="workspace"> <mode:projectionRules>/ => /</mode:projectionRules> </mode:projection> <mode:projection jcr:name="SVN for attachment projection" mode:source="SVN Store" mode:workspaceName="workspace"> <mode:projectionRules>/ => /SVNRepo</mode:projectionRules> </mode:projection> <!-- Project the 'System' content. Only needed when this source is accessed through JCR. --> <!-- mode:projection jcr:name="System projection" mode:source="System" mode:workspaceName="default"> <mode:projectionRules>/jcr:system => /</mode:projectionRules> </mode:projection--> </mode:projections> </mode:workspace> </mode:workspaces> </mode:source> </mode:sources> <mode:sequencers> <!--mode:sequencer jcr:name="Image Sequencer" mode:classname="org.modeshape.sequencer.image.ImageMetadataSequencer"> <mode:description>Image metadata sequencer</mode:description> <mode:pathExpression>/foo/source => /foo/target</mode:pathExpression> <mode:pathExpression>/bar/source => /bar/target</mode:pathExpression> </mode:sequencer--> </mode:sequencers> <mode:mimeTypeDetectors> <mode:mimeTypeDetector jcr:name="Detector"> <mode:description>Standard extension-based MIME type detector</mode:description> <mode:classname>org.modeshape.graph.mimetype.ExtensionBasedMimeTypeDetector</mode:classname> <mode:classpath/> <mode:classpath/> </mode:mimeTypeDetector> </mode:mimeTypeDetectors> <mode:repositories> <mode:repository jcr:name="Portal"> <!-- Specify the source that should be used for the repository --> <mode:source>OEA</mode:source> <!-- Define the options for the JCR repository, using camelcase version of JcrRepository.Option names --> <mode:options jcr:primaryType="mode:options"> <systemSourceName jcr:primaryType="mode:option" mode:value="system@Portal"/> <jaasLoginConfigName jcr:primaryType="mode:option" mode:value="modeshape-jcr"/> </mode:options> <!-- Define any custom node types. Importing CND files via JcrConfiguration is equivalent to specifying here. --> <mode:nodeTypes jcr:primaryType="mode:nodeTypes"/> <!-- Define any namespaces for this repository, other than those already defined by JCR or ModeShape --> <namespaces jcr:primaryType="mode:namespaces"> <ea jcr:primaryType="mode:namespace" mode:uri="http://www.oea.org"/> </namespaces> </mode:repository> </mode:repositories> </configuration>
Hoping someone already experienced this kind of trouble...
We're currently using Modeshape 2.5.0.
Thank you for your support and have a very good day
SJ.