Re: [Neo] NPE during XA transaction

2009-11-11 Thread Mattias Persson
Great to hear that this worked out for you in the end.

/ Mattias

2009/11/11 Andreas Guenther :
> Well, as it turns out all my fault as another backup process I have kicked in 
> and interfered with my reprocessing. After I synchronized these two competing 
> resources everything runs as smooth as usual again.
>
> Sorry for bothering but we are close to end of our release cycle ;)
> -Andreas
>
> P.S.
> Neo rocks!

Thanks, I know :)

>
>> -Ursprüngliche Nachricht-
>> Von: "Andreas Guenther" 
>> Gesendet: 11.11.09 20:57:51
>> An: user@lists.neo4j.org
>> Betreff: [Neo] NPE during XA transaction
>
>
>> Hi,
>>
>> I am trying to reprocess requests available from a queue into my neo store. 
>> I intentionally avoid using the bulk load feature. The idea behind the 
>> feature is to have the ability synchronizing neo with the database in case 
>> neo missed transactions and also to be able to reconstruct the store from 
>> scratch if needed. Everything works just fine when processing the queue in 
>> production, that is, where requests come in infrequently, all distributed 
>> during the day. It unfortunately fails when trying to reprocess them in fast 
>> order. It consistently happens after approx 2000 processing requests.
>>
>> Any idea what could have caused the NPE as pasted below? Looks like the 
>> 'LogBuffer writeBuffer' got assigned to NULL at one point, probably during 
>> either releaseCurrentLogFile() or close(). Anything related to log rotation, 
>> maybe? This happens on Linux with Neo4j 1.0-b10.
>>
>> Any workarounds or explanations appreciated,
>> -Andreas
>>
>> org.neo4j.impl.transaction.TransactionFailureException: Unable to commit 
>> transaction
>> ...
>> Caused by: java.lang.NullPointerException
>>         at 
>> org.neo4j.impl.transaction.xaframework.XaLogicalLog.done(XaLogicalLog.java:462)
>>         at 
>> org.neo4j.impl.transaction.xaframework.XaResourceManager.commit(XaResourceManager.java:400)
>>         at 
>> org.neo4j.impl.transaction.xaframework.XaResourceHelpImpl.commit(XaResourceHelpImpl.java:64)
>>         at 
>> org.neo4j.impl.transaction.TransactionImpl.doCommit(TransactionImpl.java:514)
>>         at org.neo4j.impl.transaction.TxManager.commit(TxManager.java:573)
>>         at org.neo4j.impl.transaction.TxManager.commit(TxManager.java:543)
>>         at 
>> org.neo4j.impl.transaction.TransactionImpl.commit(TransactionImpl.java:102)
>>         at 
>> org.neo4j.api.core.EmbeddedNeoImpl$TransactionImpl.finish(EmbeddedNeoImpl.java:395)
>> __
>> GRATIS für alle WEB.DE-Nutzer: Die maxdome Movie-FLAT!
>> Jetzt freischalten unter http://movieflat.web.de
>>
>> ___
>> Neo mailing list
>> User@lists.neo4j.org
>> https://lists.neo4j.org/mailman/listinfo/user
>>
>
>
> __
> GRATIS für alle WEB.DE-Nutzer: Die maxdome Movie-FLAT!
> Jetzt freischalten unter http://movieflat.web.de
>
> ___
> Neo mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
>



-- 
Mattias Persson, [matt...@neotechnology.com]
Neo Technology, www.neotechnology.com
___
Neo mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo] NPE during XA transaction

2009-11-11 Thread Andreas Guenther
Well, as it turns out all my fault as another backup process I have kicked in 
and interfered with my reprocessing. After I synchronized these two competing 
resources everything runs as smooth as usual again. 

Sorry for bothering but we are close to end of our release cycle ;)
-Andreas

P.S.
Neo rocks!

> -Ursprüngliche Nachricht-
> Von: "Andreas Guenther" 
> Gesendet: 11.11.09 20:57:51
> An: user@lists.neo4j.org
> Betreff: [Neo] NPE during XA transaction


> Hi,
> 
> I am trying to reprocess requests available from a queue into my neo store. I 
> intentionally avoid using the bulk load feature. The idea behind the feature 
> is to have the ability synchronizing neo with the database in case neo missed 
> transactions and also to be able to reconstruct the store from scratch if 
> needed. Everything works just fine when processing the queue in production, 
> that is, where requests come in infrequently, all distributed during the day. 
> It unfortunately fails when trying to reprocess them in fast order. It 
> consistently happens after approx 2000 processing requests.
> 
> Any idea what could have caused the NPE as pasted below? Looks like the 
> 'LogBuffer writeBuffer' got assigned to NULL at one point, probably during 
> either releaseCurrentLogFile() or close(). Anything related to log rotation, 
> maybe? This happens on Linux with Neo4j 1.0-b10.
> 
> Any workarounds or explanations appreciated,
> -Andreas
> 
> org.neo4j.impl.transaction.TransactionFailureException: Unable to commit 
> transaction
> ...
> Caused by: java.lang.NullPointerException
> at 
> org.neo4j.impl.transaction.xaframework.XaLogicalLog.done(XaLogicalLog.java:462)
> at 
> org.neo4j.impl.transaction.xaframework.XaResourceManager.commit(XaResourceManager.java:400)
> at 
> org.neo4j.impl.transaction.xaframework.XaResourceHelpImpl.commit(XaResourceHelpImpl.java:64)
> at 
> org.neo4j.impl.transaction.TransactionImpl.doCommit(TransactionImpl.java:514)
> at org.neo4j.impl.transaction.TxManager.commit(TxManager.java:573)
> at org.neo4j.impl.transaction.TxManager.commit(TxManager.java:543)
> at 
> org.neo4j.impl.transaction.TransactionImpl.commit(TransactionImpl.java:102)
> at 
> org.neo4j.api.core.EmbeddedNeoImpl$TransactionImpl.finish(EmbeddedNeoImpl.java:395)
> __
> GRATIS für alle WEB.DE-Nutzer: Die maxdome Movie-FLAT!
> Jetzt freischalten unter http://movieflat.web.de
> 
> ___
> Neo mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
> 


__
GRATIS für alle WEB.DE-Nutzer: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://movieflat.web.de

___
Neo mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


[Neo] NPE during XA transaction

2009-11-11 Thread Andreas Guenther
Hi,

I am trying to reprocess requests available from a queue into my neo store. I 
intentionally avoid using the bulk load feature. The idea behind the feature is 
to have the ability synchronizing neo with the database in case neo missed 
transactions and also to be able to reconstruct the store from scratch if 
needed. Everything works just fine when processing the queue in production, 
that is, where requests come in infrequently, all distributed during the day. 
It unfortunately fails when trying to reprocess them in fast order. It 
consistently happens after approx 2000 processing requests.

Any idea what could have caused the NPE as pasted below? Looks like the 
'LogBuffer writeBuffer' got assigned to NULL at one point, probably during 
either releaseCurrentLogFile() or close(). Anything related to log rotation, 
maybe? This happens on Linux with Neo4j 1.0-b10.

Any workarounds or explanations appreciated,
-Andreas

org.neo4j.impl.transaction.TransactionFailureException: Unable to commit 
transaction
...
Caused by: java.lang.NullPointerException
at 
org.neo4j.impl.transaction.xaframework.XaLogicalLog.done(XaLogicalLog.java:462)
at 
org.neo4j.impl.transaction.xaframework.XaResourceManager.commit(XaResourceManager.java:400)
at 
org.neo4j.impl.transaction.xaframework.XaResourceHelpImpl.commit(XaResourceHelpImpl.java:64)
at 
org.neo4j.impl.transaction.TransactionImpl.doCommit(TransactionImpl.java:514)
at org.neo4j.impl.transaction.TxManager.commit(TxManager.java:573)
at org.neo4j.impl.transaction.TxManager.commit(TxManager.java:543)
at 
org.neo4j.impl.transaction.TransactionImpl.commit(TransactionImpl.java:102)
at 
org.neo4j.api.core.EmbeddedNeoImpl$TransactionImpl.finish(EmbeddedNeoImpl.java:395)
__
GRATIS für alle WEB.DE-Nutzer: Die maxdome Movie-FLAT!
Jetzt freischalten unter http://movieflat.web.de

___
Neo mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo] Garbage nodes

2009-11-11 Thread Todd Stavish
Based on my experience with Object Databases, I can't recommend a
persistent garbage collector implementation (PGC). Just like all parts
of your object model don't need to be expressed in your graph,
persistence doesn't need garbage collectors.

Based on what I've seen implemented by customers, GC's are meant for
dynamic memory allocation only.  One consequence, we found, is that
the PGC often delays the application. To avoid this, you end up
avoiding or delaying the PGC for a long time, which means there is no
automatic GC, so ultimately the application is making a manual process
of a supposedly automatic operation.

The delay also ends up bloating the database, ie the impact of not
deleting the nodes is that you end up using more storage space, when
you create new nodes you end up allocating more because the old ones
are still around.

Not sure about Neo4j, but this also ended up fragmenting the database
files. So for us,  we found that we were setting ourselves up for
bloat and fragmentation, and poor performance because you are going to
have access more data. It was also kind of fragile, because if you
make a mistake and not root something, you may end up having the PGC
accidentally delete something that you wanted. We had a tragically sad
experience were a customer was complaining about the PGC taking a long
time, the PGC was deleting more objects then they intended, good data
was lost (the performance was fine).

Please take this as a data point on the decision, it's possible that
PGCs could be implemented in a way that don't experience these
problems, and end-users could be guided to avoid pitfalls, or PGCs
might work for a certain class of applications and not others.

-Todd







On Fri, Nov 6, 2009 at 12:47 PM, Johan Svensson  wrote:
> I'll jump in on this one then.
>
> Node or relationship IDs will only be reused if they are deleted.
> There is no possibility that any IDs change without deleting.
>
> Regards,
> -Johan
>
> On Fri, Nov 6, 2009 at 3:11 PM, Andrea Puddu  wrote:
>> Hi Peter,
>>
>> I'm sorry if I jump in the discussion. I have a question about
>> "garbage collection".
>> Are node IDs reused only if some node is deleted? I mean, is there any
>> possibility that some IDs change without deleting any nodes? And what
>> about relationship IDs?
>>
>> Thank you in advance.
>> Andrea
>>
> ___
> Neo mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
>
___
Neo mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo] Concurrent transactions

2009-11-11 Thread Daniel Martínez
Hi and thanks for the answer,

By close transaction I mean commit. The code as it is does not share
transactions.

The problematic use case is:

T1 begin
 create rel 0 -> 1
T1 commit
T1 begin
 create rel 1 -> 2
T2 begin
 create rel 0 -> 3  << deadlock
 set property 3
T2 commit
T1 set property 2
T1 commit

The case that works (with 0 -> 1 and 0 -> 3 already created):

T1 begin
 obtain 0 -> 1
 obtain 1
T1 commit
T1 begin
 create rel 1 -> 2
T2 begin
 obtain 0 -> 3
 set property 3
T2 commit
T1 set property 2
T1 commit

The goal is having 0 -> 1 -> 2 and 0 -> 3 created. I suspect the problem
lies within node 0. Is it possible that T1 locks 0 when creating 1 -> 2?

Regards,
--
Daniel Martínez


El mié, 11-11-2009 a las 14:13 +0100, Johan Svensson escribió:

> Hi,
> 
> There is no global lock in Neo4j. We lock on a relationship and node level so:
> 
> create node - write lock on created node (so other tx can't see until
> it exist for real)
> set/remove property - write lock on either the node or relationship
> create / delete relationship - write lock on the relationship and both
> nodes it is connected to
> 
> There is however a special case during relationship create/delete. For
> a short period of time (during commit) a write lock may be grabbed on
> some other relationship (connected to the same node) while updating
> the "dual interleaved linked list" storing the relationships.
> 
> I could not quite understand the use case you describe. By close you
> mean commit/rollback or suspend of transaction? If close means commit
> I get:
> 
> T1 begin
>  create rel 0 -> 1
> T1 commit
> T1 begin
>   create rel 1->2
> T2 begin
>   setProperty 2 // this will block since other open tx has created
> relationship to node 2
> 
> When T1 commits T2 can continue.
> 
> Regards,
> -Johan
> 
> On Wed, Nov 11, 2009 at 12:57 PM, Daniel Martínez
>  wrote:
> > Hi everyone,
> >
> > I am currently testing neo4j (1.0-b9)as a persistence layer for an app.
> > I have encountered an strange problem.
> >
> > I have two threads creating relations at the same time (both open
> > transactions)
> >
> > (0 is root node)
> >
> > T1(main): Begin transaction --> create relationship 0 -> 1 --> Close
> > Transaction --> Begin transaction --> create relationship 1 -> 2 -->
> > create T2 --> wait for T2 --> set property 2 -->  --> Close
> > Transaction --> 
> > T2: Begin transaction --> create relationship 0 -> 3 --> set property 3
> > --> Close Transaction
> >
> > T1 is waiting for T2 to end, but it never does because of a deadlock.
> > Why is there such a deadlock? The nodes are not the same (concurrent
> > transactions for 1->2 and 0->3 creation).
> >
> > This does not occur during this situation
> > (0->1, 0->3 exist in database, 0 is root node)
> >
> > T1(main): Begin transaction --> obtain node 1 --> Close Transaction -->
> > Begin transaction --> create relationship 1->2 --> create T2 --> wait
> > for T2 --> set property 2 -->  --> Close transaction --> 
> > T2: Begin transaction --> Obtain 3 --> set property 3 --> Close
> > Transaction
> >
> > In this case both transactions commit correctly.
> >
> > Is there a global lock in neo4j when creating relationships?
> >
> > Thanks for your help,
> > --
> > Daniel Martínez
> ___
> Neo mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user










 Soluciones de Gestión
para su empresa




  eBusiness, ERP, CRM






Daniel Martínez Martínez

Gerente
C/ Julia García Boután,
29
28022 Madrid
España









E-mail:
daniel.marti...@paradisosistemas.es
Web:
www.paradisosistemas.es
Comercial:
i...@paradisosistemas.es
Tel: 678416758








___
Neo mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo] Web Analytics Use Case

2009-11-11 Thread Peter Neubauer
Benjamin,
for small scale and fast prototyping, you can use Neoclipse,
http://wiki.neo4j.org/content/Neoclipse_Guide which we used in this
case.

For larger experiments, the JRuby bindings are quite nice, and then
you can visualize then by pointing Neoclipse to the Neo4j storage
files.

HTH

/peter neubauer

Neo Technology

GTalk:  neubauer.peter
Skype   peter.neubauer
Phone   +46 704 106975
LinkedIn   http://www.linkedin.com/in/neubauer
Twitter  http://twitter.com/peterneubauer

http://www.neo4j.org- Relationships count.
http://www.linkedprocess.org   - Distributed computing on LinkedData scale



On Wed, Nov 11, 2009 at 3:05 PM, Benjamin Dageroth
 wrote:
> Hi,
>
> thanks for the fast answers and even drawing a domain model! What did you use 
> for modeling? I have something similar on paper by now, perhaps I can 
> contribute the stuff as well and I'll try to talk my CTO into some 
> experimenting.
>
> The road to aggregation is unfortunately blocked for us, as we want our 
> customers to be able to drill down to really small groups and even single 
> visits - for this we need the raw data. Once aggregated you cannot 
> distinguish anymore and not answer all questions depending on the filters 
> that are used on the data. E.g. What are the favourite paths of Visitors from 
> Germany. Since this capability is one of the major sellingpoints of our 
> solution we'd probably try to use both databases. The relational data for all 
> kind of filtering and the graph database for path analysis.
>
> Graph Databases are really quite new yet, yes? I am trying to find some 
> literature on them, but Oreilly seem to have nothing yet on the topic.
>
> Other than often traveled paths I am by now thinking of using the database 
> for recommendation engines. Currently we use pretty much a brute force 
> approach to find out which articles have often been purchased together, but 
> with a graph database one should be able to implement algorithms which are 
> way more efficient and using information stored in the edges should also make 
> it possible to increase the quality of recommendations as more factors than 
> just the edge can be taken into account. And of course realtime 
> recommendations should be possible independent of nightly batch jobs.
>
> Thanks again for the answers,
>
> Benjamin
>
> ___
> Benjamin Dageroth, Business Development Manager
> Webtrekk GmbH
> Boxhagener Str. 76-78, 10245 Berlin
> fon 030 - 755 415 - 360
> fax 030 - 755 415 - 100
> benjamin.dager...@webtrekk.com
> http://www.webtrekk.com
> Amtsgericht Berlin, HRB 93435 B
> Geschäftsführer Christian Sauer
>
>
> ___
>
>
> -Ursprüngliche Nachricht-
> Von: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] Im 
> Auftrag von Johan Svensson
> Gesendet: Mittwoch, 11. November 2009 14:39
> An: Neo user discussions
> Betreff: Re: [Neo] Web Analytics Use Case
>
> On Wed, Nov 11, 2009 at 11:02 AM, Benjamin Dageroth
>  wrote:
>> Hi,
>> ...
>>
>> Then the best solution for this seems to me that I would run two databases: 
>> First I ask our current current database to give me all Visitors, to whom 
>> this criteria applies, and then ask neo4j to look only at the edges of these 
>> visitors. Or would neo4J be powerful enough to deliever a similar 
>> performance as traditional RDBMS Systems when confronted with data that is 
>> not really resembling a graph? Is it usually easy to transform a traditional 
>> schema into a graphDB Schema that performs just as well?
>>
>
> Hi,
>
> Running two databases (graph db + RDMS) may be good idea in this case.
> RDMS are really good at working with set operations on the full
> dataset. On the other hand it is often possible to calculate/aggregate
> such information on the fly when data is updated in a graph db.
>
> Regarding transforming a traditional schema into a graph I would say
> it is easy. I usually recommend not to look at the schema, instead
> look at the domain and its data and transform that into a graph.
> People are playing with automatic relational schema -> graph db
> transformation tools. Have a look at Peters SQL importer here:
> http://wiki.neo4j.org/content/SQL_Importer
>
> Regards,
> -Johan
> ___
> Neo mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
> ___
> Neo mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
>
___
Neo mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo] Web Analytics Use Case

2009-11-11 Thread Benjamin Dageroth
Hi,

thanks for the fast answers and even drawing a domain model! What did you use 
for modeling? I have something similar on paper by now, perhaps I can 
contribute the stuff as well and I'll try to talk my CTO into some 
experimenting.

The road to aggregation is unfortunately blocked for us, as we want our 
customers to be able to drill down to really small groups and even single 
visits - for this we need the raw data. Once aggregated you cannot distinguish 
anymore and not answer all questions depending on the filters that are used on 
the data. E.g. What are the favourite paths of Visitors from Germany. Since 
this capability is one of the major sellingpoints of our solution we'd probably 
try to use both databases. The relational data for all kind of filtering and 
the graph database for path analysis.

Graph Databases are really quite new yet, yes? I am trying to find some 
literature on them, but Oreilly seem to have nothing yet on the topic.

Other than often traveled paths I am by now thinking of using the database for 
recommendation engines. Currently we use pretty much a brute force approach to 
find out which articles have often been purchased together, but with a graph 
database one should be able to implement algorithms which are way more 
efficient and using information stored in the edges should also make it 
possible to increase the quality of recommendations as more factors than just 
the edge can be taken into account. And of course realtime recommendations 
should be possible independent of nightly batch jobs.

Thanks again for the answers,

Benjamin

___
Benjamin Dageroth, Business Development Manager
Webtrekk GmbH
Boxhagener Str. 76-78, 10245 Berlin
fon 030 - 755 415 - 360
fax 030 - 755 415 - 100
benjamin.dager...@webtrekk.com
http://www.webtrekk.com
Amtsgericht Berlin, HRB 93435 B
Geschäftsführer Christian Sauer


___


-Ursprüngliche Nachricht-
Von: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] Im 
Auftrag von Johan Svensson
Gesendet: Mittwoch, 11. November 2009 14:39
An: Neo user discussions
Betreff: Re: [Neo] Web Analytics Use Case

On Wed, Nov 11, 2009 at 11:02 AM, Benjamin Dageroth
 wrote:
> Hi,
> ...
>
> Then the best solution for this seems to me that I would run two databases: 
> First I ask our current current database to give me all Visitors, to whom 
> this criteria applies, and then ask neo4j to look only at the edges of these 
> visitors. Or would neo4J be powerful enough to deliever a similar performance 
> as traditional RDBMS Systems when confronted with data that is not really 
> resembling a graph? Is it usually easy to transform a traditional schema into 
> a graphDB Schema that performs just as well?
>

Hi,

Running two databases (graph db + RDMS) may be good idea in this case.
RDMS are really good at working with set operations on the full
dataset. On the other hand it is often possible to calculate/aggregate
such information on the fly when data is updated in a graph db.

Regarding transforming a traditional schema into a graph I would say
it is easy. I usually recommend not to look at the schema, instead
look at the domain and its data and transform that into a graph.
People are playing with automatic relational schema -> graph db
transformation tools. Have a look at Peters SQL importer here:
http://wiki.neo4j.org/content/SQL_Importer

Regards,
-Johan
___
Neo mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user
___
Neo mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo] Web Analytics Use Case

2009-11-11 Thread Johan Svensson
On Wed, Nov 11, 2009 at 11:02 AM, Benjamin Dageroth
 wrote:
> Hi,
> ...
>
> Then the best solution for this seems to me that I would run two databases: 
> First I ask our current current database to give me all Visitors, to whom 
> this criteria applies, and then ask neo4j to look only at the edges of these 
> visitors. Or would neo4J be powerful enough to deliever a similar performance 
> as traditional RDBMS Systems when confronted with data that is not really 
> resembling a graph? Is it usually easy to transform a traditional schema into 
> a graphDB Schema that performs just as well?
>

Hi,

Running two databases (graph db + RDMS) may be good idea in this case.
RDMS are really good at working with set operations on the full
dataset. On the other hand it is often possible to calculate/aggregate
such information on the fly when data is updated in a graph db.

Regarding transforming a traditional schema into a graph I would say
it is easy. I usually recommend not to look at the schema, instead
look at the domain and its data and transform that into a graph.
People are playing with automatic relational schema -> graph db
transformation tools. Have a look at Peters SQL importer here:
http://wiki.neo4j.org/content/SQL_Importer

Regards,
-Johan
___
Neo mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo] Concurrent transactions

2009-11-11 Thread Johan Svensson
Hi,

There is no global lock in Neo4j. We lock on a relationship and node level so:

create node - write lock on created node (so other tx can't see until
it exist for real)
set/remove property - write lock on either the node or relationship
create / delete relationship - write lock on the relationship and both
nodes it is connected to

There is however a special case during relationship create/delete. For
a short period of time (during commit) a write lock may be grabbed on
some other relationship (connected to the same node) while updating
the "dual interleaved linked list" storing the relationships.

I could not quite understand the use case you describe. By close you
mean commit/rollback or suspend of transaction? If close means commit
I get:

T1 begin
 create rel 0 -> 1
T1 commit
T1 begin
  create rel 1->2
T2 begin
  setProperty 2 // this will block since other open tx has created
relationship to node 2

When T1 commits T2 can continue.

Regards,
-Johan

On Wed, Nov 11, 2009 at 12:57 PM, Daniel Martínez
 wrote:
> Hi everyone,
>
> I am currently testing neo4j (1.0-b9)as a persistence layer for an app.
> I have encountered an strange problem.
>
> I have two threads creating relations at the same time (both open
> transactions)
>
> (0 is root node)
>
> T1(main): Begin transaction --> create relationship 0 -> 1 --> Close
> Transaction --> Begin transaction --> create relationship 1 -> 2 -->
> create T2 --> wait for T2 --> set property 2 -->  --> Close
> Transaction --> 
> T2: Begin transaction --> create relationship 0 -> 3 --> set property 3
> --> Close Transaction
>
> T1 is waiting for T2 to end, but it never does because of a deadlock.
> Why is there such a deadlock? The nodes are not the same (concurrent
> transactions for 1->2 and 0->3 creation).
>
> This does not occur during this situation
> (0->1, 0->3 exist in database, 0 is root node)
>
> T1(main): Begin transaction --> obtain node 1 --> Close Transaction -->
> Begin transaction --> create relationship 1->2 --> create T2 --> wait
> for T2 --> set property 2 -->  --> Close transaction --> 
> T2: Begin transaction --> Obtain 3 --> set property 3 --> Close
> Transaction
>
> In this case both transactions commit correctly.
>
> Is there a global lock in neo4j when creating relationships?
>
> Thanks for your help,
> --
> Daniel Martínez
___
Neo mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo] Web Analytics Use Case

2009-11-11 Thread Mattias Persson
Hi Benjamin, interesting problems to say the least.

Depending on the data structure and which queries are prioritized it
can be modelled differently, each solution being particularly good at
specific features/queries.

We've created a wiki page for this model as well at
http://wiki.neo4j.org/content/Site_Usage_Analytics

/ Mattias

2009/11/11 Benjamin Dageroth :
> Hi,
>
> I am currently thinking about the possible usage of neo4j for a web analytics 
> solution. Currently we are using an RDBMS (Exasol) which performs quite well, 
> but there are a few cases, which do not work well: We would like to compute 
> commonly travelled paths of users going through a website. With our current 
> solution this is pretty much impossible for any complex website.
>
> Now I was thinking, whether this is indeed a good use case for neo4j because 
> I would have to save a path in the correct order, the order in which a 
> visitor visited the pages (nodes).
>  E.g. a website which has 5 Pages (A,B,C,D,E). Three Visitors(X,Y,Z) tavel 
> through the Page.
>
> X: A, D, E, A
> Y: A, B,D,E,A
> Z: A, B, D, C,D,C,E
>
> Now I would like to know how often a path A from E was travelled, with less 
> than 3 Edges in between.
> Or I would like to know the most frequently travelled paths.
>
> Therefore my question on neo4j is basically, can I easily make these 
> computations? It seems to me that there would need be to have multiple Edges 
> between two nodes, basically each with an ID of the Visitor, is that easily 
> possible? So far I have always only seen one edge between two nodes 
> describing the relationship between the nodes and this seems to be a somewhat 
> different use case.
>
> When it comes to questions like:
> What are the most frequent paths of Visitors who bought something (or those 
> who bought nothing)?
>
> Then the best solution for this seems to me that I would run two databases: 
> First I ask our current current database to give me all Visitors, to whom 
> this criteria applies, and then ask neo4j to look only at the edges of these 
> visitors. Or would neo4J be powerful enough to deliever a similar performance 
> as traditional RDBMS Systems when confronted with data that is not really 
> resembling a graph? Is it usually easy to transform a traditional schema into 
> a graphDB Schema that performs just as well?
>
> Thanks for your answers,
>
> Benjamin
>
> ___
> Benjamin Dageroth, Business Development Manager
> Webtrekk GmbH
> Boxhagener Str. 76-78, 10245 Berlin
> fon 030 - 755 415 - 360
> fax 030 - 755 415 - 100
> benjamin.dager...@webtrekk.com
> http://www.webtrekk.com
> Amtsgericht Berlin, HRB 93435 B
> Geschäftsführer Christian Sauer
>
>
> ___
>
>
> ___
> Neo mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
>



-- 
Mattias Persson, [matt...@neotechnology.com]
Neo Technology, www.neotechnology.com
___
Neo mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


[Neo] Concurrent transactions

2009-11-11 Thread Daniel Martínez
Hi everyone,

I am currently testing neo4j (1.0-b9)as a persistence layer for an app.
I have encountered an strange problem.

I have two threads creating relations at the same time (both open
transactions)

(0 is root node)

T1(main): Begin transaction --> create relationship 0 -> 1 --> Close
Transaction --> Begin transaction --> create relationship 1 -> 2 -->
create T2 --> wait for T2 --> set property 2 -->  --> Close
Transaction --> 
T2: Begin transaction --> create relationship 0 -> 3 --> set property 3
--> Close Transaction

T1 is waiting for T2 to end, but it never does because of a deadlock.
Why is there such a deadlock? The nodes are not the same (concurrent
transactions for 1->2 and 0->3 creation).

This does not occur during this situation
(0->1, 0->3 exist in database, 0 is root node)

T1(main): Begin transaction --> obtain node 1 --> Close Transaction -->
Begin transaction --> create relationship 1->2 --> create T2 --> wait
for T2 --> set property 2 -->  --> Close transaction --> 
T2: Begin transaction --> Obtain 3 --> set property 3 --> Close
Transaction

In this case both transactions commit correctly.

Is there a global lock in neo4j when creating relationships?

Thanks for your help,
--
Daniel Martínez











___
Neo mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


[Neo] Web Analytics Use Case

2009-11-11 Thread Benjamin Dageroth
Hi,

I am currently thinking about the possible usage of neo4j for a web analytics 
solution. Currently we are using an RDBMS (Exasol) which performs quite well, 
but there are a few cases, which do not work well: We would like to compute 
commonly travelled paths of users going through a website. With our current 
solution this is pretty much impossible for any complex website.

Now I was thinking, whether this is indeed a good use case for neo4j because I 
would have to save a path in the correct order, the order in which a visitor 
visited the pages (nodes).
 E.g. a website which has 5 Pages (A,B,C,D,E). Three Visitors(X,Y,Z) tavel 
through the Page.

X: A, D, E, A
Y: A, B,D,E,A
Z: A, B, D, C,D,C,E

Now I would like to know how often a path A from E was travelled, with less 
than 3 Edges in between.
Or I would like to know the most frequently travelled paths.

Therefore my question on neo4j is basically, can I easily make these 
computations? It seems to me that there would need be to have multiple Edges 
between two nodes, basically each with an ID of the Visitor, is that easily 
possible? So far I have always only seen one edge between two nodes describing 
the relationship between the nodes and this seems to be a somewhat different 
use case.

When it comes to questions like:
What are the most frequent paths of Visitors who bought something (or those who 
bought nothing)?

Then the best solution for this seems to me that I would run two databases: 
First I ask our current current database to give me all Visitors, to whom this 
criteria applies, and then ask neo4j to look only at the edges of these 
visitors. Or would neo4J be powerful enough to deliever a similar performance 
as traditional RDBMS Systems when confronted with data that is not really 
resembling a graph? Is it usually easy to transform a traditional schema into a 
graphDB Schema that performs just as well?

Thanks for your answers,

Benjamin

___
Benjamin Dageroth, Business Development Manager
Webtrekk GmbH
Boxhagener Str. 76-78, 10245 Berlin
fon 030 - 755 415 - 360
fax 030 - 755 415 - 100
benjamin.dager...@webtrekk.com
http://www.webtrekk.com
Amtsgericht Berlin, HRB 93435 B
Geschäftsführer Christian Sauer


___


___
Neo mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo] Neo,Rest,.NET

2009-11-11 Thread Johan Svensson
On Tue, Nov 10, 2009 at 10:05 PM, Jawher  wrote:
>
> - And a *question to the neo4j team* : would using org.neo4j.scala as a
> package name and org.neo4j as a maven groupId pause a problem ?
>

No problem I think (name=neo-scala, groupId=org.neo4j,
package=org.neo4j.scala). I will bring this up for discussion with the
team this weekend.

Regards,
-Johan
___
Neo mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user