Creating users and resources and their relationship and the properties, is 
random. Each time program calls insert entity with properties, it creates a 
node or relationship (based on inputs). I'm not aware of the data 
beforehand so I have to put the insert entity function in a transaction.

On Wednesday, March 5, 2014 11:09:02 PM UTC-8, Michael Hunger wrote:
>
> If you import them all at once you should have larger transaction sizes, 
> anything from 1000 to 50000  elements per transaction.
>
> See this for an explanation: 
> http://jexp.de/blog/2013/05/on-importing-data-in-neo4j-blog-series/
>
> Michael
>
>
> Am 06.03.2014 um 07:18 schrieb Reihane Boghrati 
> <[email protected]<javascript:>
> >:
>
> I use multiple threads (200 threads).
> I have 10,000 users, 4 friends per user and 10 resource per users. The 
> relations are like:
> (users) -[firnedships]->(users)
> (resources)-[createdFor]->(users)
> (users)-[create]->(resources)
>  
> First I create all users nodes, then I create friendship between two given 
> users. Finally I create resources node and its two relationship, create and 
> createdFor. 
> Each of them is one transaction. (creating of each user, creating of each 
> friendship, creating of each resource with its relationship)
> and it takes roughly about 4 hours!!!
> Is this common, or am I doing something wrong?
>
> On Wednesday, March 5, 2014 10:03:13 PM UTC-8, Michael Hunger wrote:
>>
>> Why?
>>
>> You can load them in less than a second
>>
>> Or use multiple threads
>>
>> Sent from mobile device
>>
>> Am 06.03.2014 um 05:41 schrieb Reihane Boghrati <[email protected]>:
>>
>> I want to load my database with 10,000 users nodes with 4 process. Is 
>> there any possibility to do that? 
>> For example can I specify a different db_path for each process and run 
>> them?
>>
>> On Wednesday, March 5, 2014 8:14:14 PM UTC-8, Michael Hunger wrote:
>>>
>>> Only one active process at a time can access the storage files.
>>>
>>> What do you want to do?
>>>
>>> Michael
>>>
>>> Am 06.03.2014 um 01:03 schrieb Reihane Boghrati <[email protected]>:
>>>
>>> Hi,
>>>
>>> How can I load my database with multiple processes? 
>>>
>>> This is my init function:
>>>
>>> static GraphDatabaseService graphDb;
>>> private static final String DB_PATH = 
>>> "C:/Users/Reihane/Documents/Neo4j/default.graphdb";
>>> public boolean init() throws DBException {
>>> if (graphDb == null)
>>> graphDb = new GraphDatabaseFactory().newEmbeddedDatabase(DB_PATH);
>>> engine = new ExecutionEngine(graphDb);
>>> return true;
>>> }
>>>
>>> and this is the exception my code throws:
>>>
>>> java.lang.RuntimeException: Error starting 
>>> org.neo4j.kernel.EmbeddedGraphDatabase, 
>>> C:\Users\Reihane\Documents\Neo4j\default.graphdb
>>> at 
>>> org.neo4j.kernel.InternalAbstractGraphDatabase.run(InternalAbstractGraphDatabase.java:333)
>>> at 
>>> org.neo4j.kernel.EmbeddedGraphDatabase.<init>(EmbeddedGraphDatabase.java:63)
>>> at 
>>> org.neo4j.graphdb.factory.GraphDatabaseFactory$1.newDatabase(GraphDatabaseFactory.java:92)
>>> at 
>>> org.neo4j.graphdb.factory.GraphDatabaseBuilder.newGraphDatabase(GraphDatabaseBuilder.java:198)
>>> at 
>>> org.neo4j.graphdb.factory.GraphDatabaseFactory.newEmbeddedDatabase(GraphDatabaseFactory.java:69)
>>> at Neo4j.Neo4jClient.init(Neo4jClient.java:168)
>>> at edu.usc.bg.base.DBWrapper.init(DBWrapper.java:62)
>>> at edu.usc.bg.base.Client.executeDoLoad(Client.java:1013)
>>> at edu.usc.bg.base.Client.runBG(Client.java:892)
>>> at edu.usc.bg.BGMainClass.main(BGMainClass.java:41)
>>> Caused by: org.neo4j.kernel.lifecycle.LifecycleException: Component 
>>> 'org.neo4j.kernel.StoreLockerLifecycleAdapter@7a536ac6' was successfully 
>>> initialized, but failed to start. Please see attached cause exception.
>>> at 
>>> org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:504)
>>> at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:115)
>>> at 
>>> org.neo4j.kernel.InternalAbstractGraphDatabase.run(InternalAbstractGraphDatabase.java:310)
>>> ... 9 more
>>> Caused by: org.neo4j.kernel.StoreLockException: Unable to obtain lock on 
>>> store lock file: 
>>> C:\Users\Reihane\Documents\Neo4j\default.graphdb\store_lock. Please ensure 
>>> no other process is using this database, and that the directory is writable 
>>> (required even for read-only access)
>>> at org.neo4j.kernel.StoreLocker.checkLock(StoreLocker.java:87)
>>> at 
>>> org.neo4j.kernel.StoreLockerLifecycleAdapter.start(StoreLockerLifecycleAdapter.java:44)
>>> at 
>>> org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:498)
>>> ... 11 more
>>> Caused by: java.io.IOException: Couldn't lock lock file 
>>> C:\Users\Reihane\Documents\Neo4j\default.graphdb\lock because another 
>>> process already holds the lock.
>>> at 
>>> org.neo4j.kernel.impl.nioneo.store.FileLock.getLockFileBasedFileLock(FileLock.java:115)
>>> at 
>>> org.neo4j.kernel.impl.nioneo.store.FileLock.getOsSpecificFileLock(FileLock.java:63)
>>> at 
>>> org.neo4j.kernel.DefaultFileSystemAbstraction.tryLock(DefaultFileSystemAbstraction.java:89)
>>> at org.neo4j.kernel.StoreLocker.checkLock(StoreLocker.java:74)
>>> ... 13 more
>>>
>>> -- 
>>> You received this message because you are subscribed to the Google 
>>> Groups "Neo4j" group.
>>> To unsubscribe from this group and stop receiving emails from it, send 
>>> an email to [email protected].
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>>
>>>
>> -- 
>> You received this message because you are subscribed to the Google Groups 
>> "Neo4j" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to [email protected].
>> For more options, visit https://groups.google.com/groups/opt_out.
>>
>>
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Neo4j" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected] <javascript:>.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Neo4j" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to