hi
On Fri, Sep 2, 2011 at 10:18 AM, Anders Nawroth
<[email protected]> wrote:
> Hi!
>
>>> All modifying operations need to be performed inside a transaction. In
>>> most cases it makes sense to perform multiple operations in a single
>>> transaction. For example in a web application it may be a good fit to
>>> wrap the handling of one request in a transaction. So if a method
>>> doesn't start a transaction, it just means that it's handled at a higher
>>> level in the application.
>> got this part. then do you suggest to leave indexing action outside of
>> node operation? say i have a domain model and it handles indexing
>> actions along with underlying nodes modification, then in an web app,
>> should I wrap only nodes operations inside transaction and do indexing
>> only after it success?
>
> Seems like the node and index modifications belong in the same
> transaction, to make sure any modifications to nodes are always
> reflected in the indexes as well. Otherwise they could get out of sync
> if your application crashes after the commit of the first,
> node-modifying transaction.
it seems confusing. if indexing actions wrapped inside a transaction
and the transaction fails, will indexing action automatically get
rollback? think this example:
class User{
public void dosomething(){
//node actions
//index actions
}
}
class Ext extends ServerPlugin{
public action(){
// get an array of users;
Transaction tx = graphDb.beginTx();
try
{
... // operations that work with the graph
for(User u:users){
u.dosomething();
}
tx.success();
}
finally
{
tx.finish();
}
}
}
>
> /anders
>
>
>>>
>>>
>>> /anders
>>>
>>>> 4, what's the best practice to do bulk insertion when running (not
>>>> seed initial data)? i read post says that too many insertions within a
>>>> transaction may lead to memory problem? what's the proper mount of
>>>> insertion within a transaction?
>>>> 5, is there a suggested max length for string/array property? would it
>>>> be better to put into sql?
>>>> 6, say a facebook user may "likes" thousands of things, and these
>>>> things are sparsly connected. in this case, things should be modeled
>>>> as nodes or array property?
>>>> 7, where can i find an example to use domain models with serverplugin?
>>>> i want to put my data in a standalone server and just use the
>>>> serverplugin, unmanaged extension. should i just put the domain models
>>>> into the same serverplugin jar?
>>>> 8, the warning in the documentation about unmanaged extension is
>>>> scary. what i can see is that people may use bad ways, instead of
>>>> Iterator/IteratorWrappers. any comment on this?
>>>> 9, i'm not sure if it's trival: find out users who are only 2
>>>> relationships a way (use twitter example: my followees' followers),
>>>> live in same city, group by age and gender. also retrieve all their
>>>> followees. i want to do the traversal in java, where can i find an
>>>> examples?
>>>> 10, i've had horrible experience in turning jvm options. have neo4j
>>>> been running on Zing JVM, hp nonstop jvm? are they better options?
>>>>
>>>> thanks in advance
>>>>
>>>>
>>>> Best regards
>>>>
>>>> Linan Wang
>>>> _______________________________________________
>>>> Neo4j mailing list
>>>> [email protected]
>>>> https://lists.neo4j.org/mailman/listinfo/user
>>> _______________________________________________
>>> Neo4j mailing list
>>> [email protected]
>>> https://lists.neo4j.org/mailman/listinfo/user
>>>
>>
>>
>>
> _______________________________________________
> Neo4j mailing list
> [email protected]
> https://lists.neo4j.org/mailman/listinfo/user
>
--
Best regards
Linan Wang
_______________________________________________
Neo4j mailing list
[email protected]
https://lists.neo4j.org/mailman/listinfo/user