jackrabbit-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Cristian Grozea (JIRA)" <j...@apache.org>
Subject [jira] Commented: (JCR-588) unable to batch create then save 100000 nodes under the root node; it works with 10000
Date Fri, 06 Oct 2006 16:43:32 GMT
    [ http://issues.apache.org/jira/browse/JCR-588?page=comments#action_12440519 ] 
            
Cristian Grozea commented on JCR-588:
-------------------------------------

Hello Stefan,

I tried to save smaller batches, using this modification to the code (on Windows XP+ntfs):
for (i = 0; i < 100000; i++) {
					Node hello = root.addNode("gct" + i);
					// Node world = hello.addNode("world");
					hello.setProperty("message", "gctHello, World!" + i);
					System.out.println(i);
					if(i % 1000==0)session.save(); //here, save everu 1000 objects
				}
				session.save();

It saves successfuly 37 batches of 1000 rows, but it fails on the 38th with this error:
37999
38000
ERROR - failed to write node state: cafebabe-cafe-babe-cafe-babecafebabe
ERROR 22001: A truncation error was encountered trying to shrink BLOB 'XX-RESOLVE-XX' to length
1048576.
	at org.apache.derby.iapi.error.StandardException.newException(Unknown Source)
	at org.apache.derby.iapi.types.SQLBinary.checkHostVariable(Unknown Source)
	at org.apache.derby.exe.ac597e80e5x010ex1e71xe2a0x00000006ffd82.e3(Unknown Source)
	at org.apache.derby.impl.services.reflect.DirectCall.invoke(Unknown Source)
	at org.apache.derby.impl.sql.execute.ProjectRestrictResultSet.doProjection(Unknown Source)
	at org.apache.derby.impl.sql.execute.ProjectRestrictResultSet.getNextRowCore(Unknown Source)
	at org.apache.derby.impl.sql.execute.NormalizeResultSet.getNextRowCore(Unknown Source)
	at org.apache.derby.impl.sql.execute.DMLWriteResultSet.getNextRowCore(Unknown Source)
	at org.apache.derby.impl.sql.execute.UpdateResultSet.collectAffectedRows(Unknown Source)
	at org.apache.derby.impl.sql.execute.UpdateResultSet.open(Unknown Source)
	at org.apache.derby.impl.sql.GenericPreparedStatement.execute(Unknown Source)
	at org.apache.derby.impl.jdbc.EmbedStatement.executeStatement(Unknown Source)
	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeStatement(Unknown Source)
	at org.apache.derby.impl.jdbc.EmbedPreparedStatement.executeUpdate(Unknown Source)
	at org.apache.jackrabbit.core.state.db.SimpleDbPersistenceManager.store(SimpleDbPersistenceManager.java:585)
	at org.apache.jackrabbit.core.state.AbstractPersistenceManager.store(AbstractPersistenceManager.java:75)
	at org.apache.jackrabbit.core.state.db.SimpleDbPersistenceManager.store(SimpleDbPersistenceManager.java:446)
	at org.apache.jackrabbit.core.state.SharedItemStateManager$Update.end(SharedItemStateManager.java:569)
	at org.apache.jackrabbit.core.state.SharedItemStateManager.update(SharedItemStateManager.java:692)
	at org.apache.jackrabbit.core.state.LocalItemStateManager.update(LocalItemStateManager.java:315)
	at org.apache.jackrabbit.core.state.XAItemStateManager.update(XAItemStateManager.java:322)
	at org.apache.jackrabbit.core.state.LocalItemStateManager.update(LocalItemStateManager.java:291)
	at org.apache.jackrabbit.core.state.SessionItemStateManager.update(SessionItemStateManager.java:257)
	at org.apache.jackrabbit.core.ItemImpl.save(ItemImpl.java:1189)
	at org.apache.jackrabbit.core.SessionImpl.save(SessionImpl.java:805)
	at FirstHop.main(FirstHop.java:38)
Exception in thread "main" javax.jcr.ItemNotFoundException: 0a051552-8a56-4ee1-a52e-6de8eb6ba1eb/{http://www.jcp.org/jcr/1.0}primaryType
	at org.apache.jackrabbit.core.ItemManager.createItemInstance(ItemManager.java:464)
	at org.apache.jackrabbit.core.ItemManager.getItem(ItemManager.java:320)
	at org.apache.jackrabbit.core.ItemImpl.restoreTransientItems(ItemImpl.java:708)
	at org.apache.jackrabbit.core.ItemImpl.save(ItemImpl.java:1208)
	at org.apache.jackrabbit.core.SessionImpl.save(SessionImpl.java:805)
	at FirstHop.main(FirstHop.java:38)

To conclude, the bug is still there, and the work-around is not working either ( nor the other
work-around -Xmx300m are enough for adding a batch of 10000 nodes, so it should be enough
to add 10 times fewer nodes in a batch). Please test yourself and then re-open the issue.

> unable to batch create then save 100000 nodes under the root node; it works with 10000
> --------------------------------------------------------------------------------------
>
>                 Key: JCR-588
>                 URL: http://issues.apache.org/jira/browse/JCR-588
>             Project: Jackrabbit
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 1.0.1
>         Environment: Tested both on Linux (Debian testing + sun jdk 1.5) and Windows
XP +sun jdk 1.5 both with -Xmx300m
> It fails identical on both.
>            Reporter: Cristian Grozea
>         Assigned To: Stefan Guggisberg
>            Priority: Minor
>
> When using the JackRabbit with the simplest setup, as described in the "FirstHops", the
following code succeeds when the number of node to be created is 10000, but not when it is
100000.
> ---------------------
> Code:
> 			for (i = 0; i < 100000; i++) {
> 					Node hello = root.addNode("gct" + i);
> 					// Node world = hello.addNode("world");
> 					hello.setProperty("message", "gctHello, World!" + i);
> 					System.out.println(i);
> 				}
> 				session.save();
> ---------------------
> ---------------------
> Error:
> when run with -Xmx450m
> 99997
> 99998
> 99999
> Exception in thread "main" javax.jcr.ItemNotFoundException: 421f4202-66c5-4cc3-950c-09c64bfcfe63/{}message
> 	at org.apache.jackrabbit.core.ItemManager.createItemInstance(ItemManager.java:464)
> 	at org.apache.jackrabbit.core.ItemManager.getItem(ItemManager.java:320)
> 	at org.apache.jackrabbit.core.ItemImpl.restoreTransientItems(ItemImpl.java:708)
> 	at org.apache.jackrabbit.core.ItemImpl.save(ItemImpl.java:1208)
> 	at org.apache.jackrabbit.core.SessionImpl.save(SessionImpl.java:805)
> 	at FirstHop.main(FirstHop.java:39)
> when run with -Xmx300m
> 99997
> 99998
> 99999
> Exception in thread "main" javax.jcr.RepositoryException: failed to create transient
state: there's already a node state instance with id cafebabe-cafe-babe-cafe-babecafebabe:
there's already a node state instance with id cafebabe-cafe-babe-cafe-babecafebabe
> 	at org.apache.jackrabbit.core.NodeImpl.getOrCreateTransientItemState(NodeImpl.java:287)
> 	at org.apache.jackrabbit.core.NodeImpl.restoreTransient(NodeImpl.java:962)
> 	at org.apache.jackrabbit.core.ItemImpl.restoreTransientItems(ItemImpl.java:714)
> 	at org.apache.jackrabbit.core.ItemImpl.save(ItemImpl.java:1208)
> 	at org.apache.jackrabbit.core.SessionImpl.save(SessionImpl.java:805)
> 	at FirstHop.main(FirstHop.java:39)
> Caused by: org.apache.jackrabbit.core.state.ItemStateException: there's already a node
state instance with id cafebabe-cafe-babe-cafe-babecafebabe
> 	at org.apache.jackrabbit.core.state.TransientItemStateManager.createNodeState(TransientItemStateManager.java:211)
> 	at org.apache.jackrabbit.core.state.SessionItemStateManager.createTransientNodeState(SessionItemStateManager.java:499)
> 	at org.apache.jackrabbit.core.NodeImpl.getOrCreateTransientItemState(NodeImpl.java:276)
> 	... 5 more
> org.apache.jackrabbit.core.state.ItemStateException: there's already a node state instance
with id cafebabe-cafe-babe-cafe-babecafebabe
> 	at org.apache.jackrabbit.core.state.TransientItemStateManager.createNodeState(TransientItemStateManager.java:211)
> 	at org.apache.jackrabbit.core.state.SessionItemStateManager.createTransientNodeState(SessionItemStateManager.java:499)
> 	at org.apache.jackrabbit.core.NodeImpl.getOrCreateTransientItemState(NodeImpl.java:276)
> 	at org.apache.jackrabbit.core.NodeImpl.restoreTransient(NodeImpl.java:962)
> 	at org.apache.jackrabbit.core.ItemImpl.restoreTransientItems(ItemImpl.java:714)
> 	at org.apache.jackrabbit.core.ItemImpl.save(ItemImpl.java:1208)
> 	at org.apache.jackrabbit.core.SessionImpl.save(SessionImpl.java:805)
> 	at FirstHop.main(FirstHop.java:39)
> ---------------------

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message