Details
-
Bug
-
Resolution: Done
-
Major
-
5.2.0.Final
-
None
Description
Reading files from git through Modeshape with help from the git connector is working fine for small files but for big files this is failing with the following error:
Caused by: org.modeshape.persistence.file.FileProviderException: An active transaction is required, but wasn't detected at org.modeshape.persistence.file.FileDb.transactionalContent(FileDb.java:251) at org.modeshape.persistence.file.FileDb.editContent(FileDb.java:131) at org.modeshape.jcr.cache.document.LocalDocumentStore.edit(LocalDocumentStore.java:178) at org.modeshape.jcr.federation.FederatedDocumentStore.edit(FederatedDocumentStore.java:348) at org.modeshape.jcr.cache.document.DocumentTranslator.incrementBinaryReferenceCount(DocumentTranslator.java:1249) at org.modeshape.jcr.cache.document.DocumentTranslator.valueToDocument(DocumentTranslator.java:1222) at org.modeshape.jcr.cache.document.DocumentTranslator.setProperty(DocumentTranslator.java:425) at org.modeshape.jcr.federation.FederatedDocumentWriter.addProperty(FederatedDocumentWriter.java:131) at org.modeshape.connector.git.GitTree.addInformationForPath(GitTree.java:239) at org.modeshape.connector.git.GitTree.execute(GitTree.java:128) at org.modeshape.connector.git.GitConnector.getDocumentById(GitConnector.java:233)
What I have seen in the source from the git connector is that it handles huge files differently from small files. Line 230 found here: https://github.com/ModeShape/modeshape/blob/master/connectors/modeshape-connector-git/src/main/java/org/modeshape/connector/git/GitTree.java#L230
I haven't found out what Git considers a huge file and what not. So far I have had it working with a 46MB file but not with a 126MB file.
The method values.binaryFrom(fileLoader.openStream()); attempts to create & store a ModeShape binary value for that particular Git value without an existing transaction (the entire flow is simply reading stuff from Git).