Re: [Neo4j] [Neo] Transactions in Neo4j REST Server

2010-11-02 Thread Kiss Miklós
Hi Jim,

Yes, I mean controlling transaction lifecycle. Support for bulk 
uploading won't fit all my needs.
I guess I'll have to write my own DB server for my own needs.

MikKi

2010.10.29. 17:35 keltezéssel, Jim Webber írta:
 Hi MikKi,

 Transactions are everywhere in Neo4j, in fact each time you use the REST API 
 a transaction wraps the work on the underlying graph store.

 I suspect you're wanting to control transaction lifecycle so that you can do 
 bulk inserts for example?

 I have to say I'm not keen at all on exposing transactions outside the 
 server, they're a database thing not a network thing (influenced by Pat 
 Helland's work: http://msdn.microsoft.com/en-us/library/ms954587.aspx). 
 However I would like to see the ability to do bulk uploads and I want to 
 design that into the REST API in the future.

 I don't have any timescales around this specifically, but I am now a full 
 time committer to Neo4j and I'm focussing my efforts on creating a server 
 product that fulfils these kind of ambitions (since I share them), and other 
 more mundane, but critically important, aspects like alerting, monitoring, 
 etc.

 However, in the short term (hopefully in the current snapshot release due out 
 in a week) there'll be the option to register your own code at a URI on the 
 server. If you can't wait for me to get on to it, then in the meantime you 
 should easily be able to write your own bulk uploader and host it on the Neo 
 Server.

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



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


Re: [Neo4j] [Neo] Transactions in Neo4j REST Server

2010-11-02 Thread Jim Webber
Hey MikKi,

Could you elaborate a bit more on your use case? If you want transaction 
control then perhaps it's widespread enough that other folks would want it too.

Jim


On 2 Nov 2010, at 09:16, Kiss Miklós wrote:

 Hi Jim,
 
 Yes, I mean controlling transaction lifecycle. Support for bulk 
 uploading won't fit all my needs.
 I guess I'll have to write my own DB server for my own needs.
 
 MikKi
 
 2010.10.29. 17:35 keltezéssel, Jim Webber írta:
 Hi MikKi,
 
 Transactions are everywhere in Neo4j, in fact each time you use the REST API 
 a transaction wraps the work on the underlying graph store.
 
 I suspect you're wanting to control transaction lifecycle so that you can do 
 bulk inserts for example?
 
 I have to say I'm not keen at all on exposing transactions outside the 
 server, they're a database thing not a network thing (influenced by Pat 
 Helland's work: http://msdn.microsoft.com/en-us/library/ms954587.aspx). 
 However I would like to see the ability to do bulk uploads and I want to 
 design that into the REST API in the future.
 
 I don't have any timescales around this specifically, but I am now a full 
 time committer to Neo4j and I'm focussing my efforts on creating a server 
 product that fulfils these kind of ambitions (since I share them), and other 
 more mundane, but critically important, aspects like alerting, monitoring, 
 etc.
 
 However, in the short term (hopefully in the current snapshot release due 
 out in a week) there'll be the option to register your own code at a URI on 
 the server. If you can't wait for me to get on to it, then in the meantime 
 you should easily be able to write your own bulk uploader and host it on the 
 Neo Server.
 
 Jim
 ___
 Neo4j mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user
 
 
 
 ___
 Neo4j mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user

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


Re: [Neo4j] [Neo] Transactions in Neo4j REST Server

2010-11-02 Thread Kiss Miklós
I'm still in designing phase of my system so I have no specific 
situations yet.

I think that transactions would be required for me to do the following 
as 1 atomic operation:
- create a (few) new nodes
- link the nodes into the graph
- add indices
- change some other node properties
If at any point one operation fails it should cancel all the others 
(like ACID transactions in simple neo4j do).

Or can this be done as a bulk upload? If so, how can cancelling be done?

MikKi
 Hey MikKi,

 Could you elaborate a bit more on your use case? If you want transaction 
 control then perhaps it's widespread enough that other folks would want it 
 too.

 Jim


 On 2 Nov 2010, at 09:16, Kiss Miklós wrote:

 Hi Jim,

 Yes, I mean controlling transaction lifecycle. Support for bulk
 uploading won't fit all my needs.
 I guess I'll have to write my own DB server for my own needs.

 MikKi

 2010.10.29. 17:35 keltezéssel, Jim Webber írta:
 Hi MikKi,

 Transactions are everywhere in Neo4j, in fact each time you use the REST 
 API a transaction wraps the work on the underlying graph store.

 I suspect you're wanting to control transaction lifecycle so that you can 
 do bulk inserts for example?

 I have to say I'm not keen at all on exposing transactions outside the 
 server, they're a database thing not a network thing (influenced by Pat 
 Helland's work: http://msdn.microsoft.com/en-us/library/ms954587.aspx). 
 However I would like to see the ability to do bulk uploads and I want to 
 design that into the REST API in the future.

 I don't have any timescales around this specifically, but I am now a full 
 time committer to Neo4j and I'm focussing my efforts on creating a server 
 product that fulfils these kind of ambitions (since I share them), and 
 other more mundane, but critically important, aspects like alerting, 
 monitoring, etc.

 However, in the short term (hopefully in the current snapshot release due 
 out in a week) there'll be the option to register your own code at a URI on 
 the server. If you can't wait for me to get on to it, then in the meantime 
 you should easily be able to write your own bulk uploader and host it on 
 the Neo Server.

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


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



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


Re: [Neo4j] [Neo] Transactions in Neo4j REST Server

2010-10-29 Thread Kiss Miklós
Hi all,

I'd like to ask about the status of neo4j REST transaction support. I'm 
using 0.8 and as far as I know it doesn't support it.
Will it be supported sometime in the near future (beginning of 2011)? Or 
shall I search for something different than neo4j?

Regards,
MikKi

2010.05.20. 21:05 keltezéssel, Rick Bullotta írta:
 Sounds a lot like code ;-)

 Rick

 -Original Message-
 From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On
 Behalf Of Tobias Ivarsson
 Sent: Thursday, May 20, 2010 2:55 PM
 To: Neo user discussions
 Subject: Re: [Neo] Transactions in Neo4j REST Server

 Hi buddies!

 My vote is for adding support for posting a batch of operations to be
 executed within the context of one transaction. What we need to figure out
 is how these should be expressed. Starting from a list of requirements is
 usually a good idea. The features I can think of that the batch operations
 should be able to do is:
 * Create nodes
 * Create relationships
 * Assign/update/remove properties
 * Verify assumptions

 The verification of assumptions is the trickiest part. The easies way I can
 think of for doing this is to have the client read all interesting state
 using the current API, then build a set of operations to post to the server,
 including a set of pre-conditions that need to validate for the transaction
 to be executed. If the operations fail the response will contain the failing
 conditions and the client can either drop the request or create a new
 request, either from scratch or based on the previous one and the
 information about the failing conditions.

 It might be more useful though to allow the operations to read state and
 decide on actions based on that. But supporting that is much harder, the
 set of operations is starting to approach a script in some programming
 language at that point.

 Like dr Webber I believe that allowing for client side (explicit)
 transaction management will lead to resource starvation.

 Just the thoughts I've been having around this, WDYT?

 Cheers,
 Tobias

 On Thu, May 20, 2010 at 5:51 PM, Kevin Raisonrai...@chatsubo.net  wrote:

 I am in a situation where being able to bulk upload an ntriples-like
 file or perhaps a large JSON data blob via the REST interface as a
 single transaction would be incredibly helpful.  Consider this a feature
 request.  Thanks for your work on this!

 Cheers.
 Kevin

 On 5/20/10 6:14 AM, Jim Webber wrote:
 Hi fellow graph-tastic people,

 Allowing a transaction to span multiple requests was ruled out in the
 early version of the REST API. It's a dangerous pattern that allows for
 inadvertent (or even malicious) denial of service.
 If we're going to build systems that sympathetic to the Web, then
 exposing transactions like this is not the way to go.
 Having said that, the REST API will need more functionality and that new
 functionality will need to address transactionality, but it will need to
 do
 so in a way that doesn't compromise its Web-iness. Rick's response is one
 approach, where a transaction is modelled as a resource; another approach
 might be to submit a transactional workflow through the API and get a
 result graph/set back.
 I promise I'll do some work on the API again soon. So start yelling your
 requirements and I'll prioritise them (and will ignore the ones that are
 too
 hard for me to implement, naturally :-)
 Jim
 ___
 Neo mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user

 --
 Kevin Raison
 Founder, CTO

 Chatsubo.net, LLC
 9708 1st Ave NW
 Seattle, WA 98117
 rai...@chatsubo.net

 ph: +1 (206) 801-5728
 fx: +1 (206) 801-5729
 ___
 Neo mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user




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


Re: [Neo4j] [Neo] Transactions in Neo4j REST Server

2010-10-29 Thread Jim Webber
Hi MikKi,

Transactions are everywhere in Neo4j, in fact each time you use the REST API a 
transaction wraps the work on the underlying graph store.

I suspect you're wanting to control transaction lifecycle so that you can do 
bulk inserts for example?

I have to say I'm not keen at all on exposing transactions outside the server, 
they're a database thing not a network thing (influenced by Pat Helland's work: 
http://msdn.microsoft.com/en-us/library/ms954587.aspx). However I would like to 
see the ability to do bulk uploads and I want to design that into the REST API 
in the future.

I don't have any timescales around this specifically, but I am now a full time 
committer to Neo4j and I'm focussing my efforts on creating a server product 
that fulfils these kind of ambitions (since I share them), and other more 
mundane, but critically important, aspects like alerting, monitoring, etc.

However, in the short term (hopefully in the current snapshot release due out 
in a week) there'll be the option to register your own code at a URI on the 
server. If you can't wait for me to get on to it, then in the meantime you 
should easily be able to write your own bulk uploader and host it on the Neo 
Server.

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


Re: [Neo] Transactions in Neo4j REST Server

2010-05-21 Thread Mattias Persson
What I don't like about uploading a block of code (in whatever
format/language) to pose as a transaction is that transactions don't
become transparent as they would be if you would use an embedded
instance. You can't just do: Oh, wait I should've put the transaction
handling THERE in my application instead, it makes more sense.
Instead you must know before-hand all your transaction points and it
gets harder to change those later on. You also must write your code
(be it PHP or whatever) differently if it will be grouped in
transactions or not, unless you use some kind of library on top of the
REST API which could mimic that grouping behaviour for you.

Uploading a block of code to execute on the server could be cool as
well, but I don't see that as the only way of doing
bigger-than-one-operation transactions.

2010/5/20 Tobias Ivarsson tobias.ivars...@neotechnology.com:
 It does, doesn't it ;-)

 And I'm trying to keep the code as simple as possible...

 .. because for really complex things I think that uploading real code to the
 server and mount it on a separate URI in the REST server would be more
 efficient ...

 -tobias

 On Thu, May 20, 2010 at 9:05 PM, Rick Bullotta 
 rick.bullo...@burningskysoftware.com wrote:

 Sounds a lot like code ;-)

 Rick

 -Original Message-
 From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org]
 On
 Behalf Of Tobias Ivarsson
 Sent: Thursday, May 20, 2010 2:55 PM
 To: Neo user discussions
 Subject: Re: [Neo] Transactions in Neo4j REST Server

 Hi buddies!

 My vote is for adding support for posting a batch of operations to be
 executed within the context of one transaction. What we need to figure out
 is how these should be expressed. Starting from a list of requirements is
 usually a good idea. The features I can think of that the batch operations
 should be able to do is:
 * Create nodes
 * Create relationships
 * Assign/update/remove properties
 * Verify assumptions

 The verification of assumptions is the trickiest part. The easies way I can
 think of for doing this is to have the client read all interesting state
 using the current API, then build a set of operations to post to the
 server,
 including a set of pre-conditions that need to validate for the transaction
 to be executed. If the operations fail the response will contain the
 failing
 conditions and the client can either drop the request or create a new
 request, either from scratch or based on the previous one and the
 information about the failing conditions.

 It might be more useful though to allow the operations to read state and
 decide on actions based on that. But supporting that is much harder, the
 set of operations is starting to approach a script in some programming
 language at that point.

 Like dr Webber I believe that allowing for client side (explicit)
 transaction management will lead to resource starvation.

 Just the thoughts I've been having around this, WDYT?

 Cheers,
 Tobias

 On Thu, May 20, 2010 at 5:51 PM, Kevin Raison rai...@chatsubo.net wrote:

  I am in a situation where being able to bulk upload an ntriples-like
  file or perhaps a large JSON data blob via the REST interface as a
  single transaction would be incredibly helpful.  Consider this a feature
  request.  Thanks for your work on this!
 
  Cheers.
  Kevin
 
  On 5/20/10 6:14 AM, Jim Webber wrote:
   Hi fellow graph-tastic people,
  
   Allowing a transaction to span multiple requests was ruled out in the
  early version of the REST API. It's a dangerous pattern that allows for
  inadvertent (or even malicious) denial of service.
  
   If we're going to build systems that sympathetic to the Web, then
  exposing transactions like this is not the way to go.
  
   Having said that, the REST API will need more functionality and that
 new
  functionality will need to address transactionality, but it will need to
 do
  so in a way that doesn't compromise its Web-iness. Rick's response is one
  approach, where a transaction is modelled as a resource; another approach
  might be to submit a transactional workflow through the API and get a
  result graph/set back.
  
   I promise I'll do some work on the API again soon. So start yelling
 your
  requirements and I'll prioritise them (and will ignore the ones that are
 too
  hard for me to implement, naturally :-)
  
   Jim
   ___
   Neo mailing list
   User@lists.neo4j.org
   https://lists.neo4j.org/mailman/listinfo/user
  
 
  --
  Kevin Raison
  Founder, CTO
 
  Chatsubo.net, LLC
  9708 1st Ave NW
  Seattle, WA 98117
  rai...@chatsubo.net
 
  ph: +1 (206) 801-5728
  fx: +1 (206) 801-5729
  ___
  Neo mailing list
  User@lists.neo4j.org
  https://lists.neo4j.org/mailman/listinfo/user
 



 --
 Tobias Ivarsson tobias.ivars...@neotechnology.com
 Hacker, Neo Technology
 www.neotechnology.com
 Cellphone: +46 706 534857
 ___
 Neo

Re: [Neo] Transactions in Neo4j REST Server

2010-05-20 Thread Anders Nawroth
Hi!

The guys who wrote the REST component are offline at the moment, so I'll 
just chime in here for now.

You are right that the current REST API won't allow you to control 
transactions: it wraps each request in a transaction.

There's basically two strategies, either you keep a transaction open 
spanning multiple requests, or you bundle the operations together 
somehow and send them in a single request.

It would be interesting to hear some different views on this topic from 
the community - what would be useful to you?


/anders

Javier de la Rosa wrote:
 Hi all,
 
 I think there's no way to perform a transaction through Neo4j REST
 Server. It would be great if we could emulate this behaviour using the
 header Keep-Alive, some session variable or some persistence issue.
 A good option can be the next (I'm guessing Neo4j isn't able to manage
 several transactions simultaniously, but I don't really know):
 Create transaction
 POST /transaction
 
 Example using curl
 $ curl -H Accept:application/json -X POST 
 http://localhost:/transaction
 
 Response
 201: OK, a transaction was created
 409: Transaction already in progress
 
 Since that moment, whatever you do will be under the transaction. When
 you finish the transaction. the DELETE verb has to be invoked over
 /transaction:
 DELETE /transaction
 
 Example using curl
 $ curl -X DELETE http://localhost:/transaction
 
 Response
 204: OK, no content returned
 404: Transaction not found
 
 What do you think about this? Is it too many complicated? Is it possible?
 
 Best regards.
 
 
 
___
Neo mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo] Transactions in Neo4j REST Server

2010-05-20 Thread rick . bullotta
   REST purists prefer that each REST-ful invocation is atomic, but as
   we all know, there are definitely cases where multiple transactions
   need to be implemented.



   The cleanest approach I've seen involved an explicit call to create a
   transaction/unit of work, and some type of transaction token/ID and/or
   URL would be returned (a new URI resource) that would be passed as part
   of subsequent REST-ful calls as either part of the URL or as a header.
   Then, the original URI resource could be used to complete/rollback the
   transaction [1]http://server/Neo4J/Transaction/87342342344/Commit or
   [2]http://server/Neo4J/Transaction/87342342344/Fail.



   I think Javier's proposal is similar, but what I would avoid is
   inferring transactions between a client and server in the way Javier
   describes, and instead making the transaction identifier a part of the
   URL or delivered as a header.



   I also like his approach of using well-known HTTP result codes to
   manage the transaction lifecycle.



   Rick

    Original Message 
   Subject: Re: [Neo] Transactions in Neo4j REST Server
   From: Anders Nawroth and...@neotechnology.com
   Date: Thu, May 20, 2010 9:00 am
   To: Neo user discussions user@lists.neo4j.org
   Hi!
   The guys who wrote the REST component are offline at the moment, so
   I'll
   just chime in here for now.
   You are right that the current REST API won't allow you to control
   transactions: it wraps each request in a transaction.
   There's basically two strategies, either you keep a transaction open
   spanning multiple requests, or you bundle the operations together
   somehow and send them in a single request.
   It would be interesting to hear some different views on this topic from
   the community - what would be useful to you?
   /anders
   Javier de la Rosa wrote:
Hi all,
   
I think there's no way to perform a transaction through Neo4j REST
Server. It would be great if we could emulate this behaviour using
   the
header Keep-Alive, some session variable or some persistence issue.
A good option can be the next (I'm guessing Neo4j isn't able to
   manage
several transactions simultaniously, but I don't really know):
Create transaction
POST /transaction
   
Example using curl
$ curl -H Accept:application/json -X POST
   [3]http://localhost:/transaction
   
Response
201: OK, a transaction was created
409: Transaction already in progress
   
Since that moment, whatever you do will be under the transaction.
   When
you finish the transaction. the DELETE verb has to be invoked over
/transaction:
DELETE /transaction
   
Example using curl
$ curl -X DELETE [4]http://localhost:/transaction
   
Response
204: OK, no content returned
404: Transaction not found
   
What do you think about this? Is it too many complicated? Is it
   possible?
   
Best regards.
   
   
   
   ___
   Neo mailing list
   User@lists.neo4j.org
   [5]https://lists.neo4j.org/mailman/listinfo/user

References

   1. http://server/Neo4J/Transaction/87342342344/Commit
   2. http://server/Neo4J/Transaction/87342342344/Fail
   3. http://localhost:/transaction
   4. http://localhost:/transaction
   5. https://lists.neo4j.org/mailman/listinfo/user
___
Neo mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo] Transactions in Neo4j REST Server

2010-05-20 Thread Jim Webber
Hi fellow graph-tastic people,

Allowing a transaction to span multiple requests was ruled out in the early 
version of the REST API. It's a dangerous pattern that allows for inadvertent 
(or even malicious) denial of service. 

If we're going to build systems that sympathetic to the Web, then exposing 
transactions like this is not the way to go.

Having said that, the REST API will need more functionality and that new 
functionality will need to address transactionality, but it will need to do so 
in a way that doesn't compromise its Web-iness. Rick's response is one 
approach, where a transaction is modelled as a resource; another approach might 
be to submit a transactional workflow through the API and get a result 
graph/set back.

I promise I'll do some work on the API again soon. So start yelling your 
requirements and I'll prioritise them (and will ignore the ones that are too 
hard for me to implement, naturally :-)

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


Re: [Neo] Transactions in Neo4j REST Server

2010-05-20 Thread Javier de la Rosa
Thank you all, your ideas are great.
I guess to introduce some kind of pagination only make harder the work :-)
but it continues being interesting.

Best regards.

-- 
Javier de la Rosa
___
Neo mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo] Transactions in Neo4j REST Server

2010-05-20 Thread Tobias Ivarsson
Hi buddies!

My vote is for adding support for posting a batch of operations to be
executed within the context of one transaction. What we need to figure out
is how these should be expressed. Starting from a list of requirements is
usually a good idea. The features I can think of that the batch operations
should be able to do is:
* Create nodes
* Create relationships
* Assign/update/remove properties
* Verify assumptions

The verification of assumptions is the trickiest part. The easies way I can
think of for doing this is to have the client read all interesting state
using the current API, then build a set of operations to post to the server,
including a set of pre-conditions that need to validate for the transaction
to be executed. If the operations fail the response will contain the failing
conditions and the client can either drop the request or create a new
request, either from scratch or based on the previous one and the
information about the failing conditions.

It might be more useful though to allow the operations to read state and
decide on actions based on that. But supporting that is much harder, the
set of operations is starting to approach a script in some programming
language at that point.

Like dr Webber I believe that allowing for client side (explicit)
transaction management will lead to resource starvation.

Just the thoughts I've been having around this, WDYT?

Cheers,
Tobias

On Thu, May 20, 2010 at 5:51 PM, Kevin Raison rai...@chatsubo.net wrote:

 I am in a situation where being able to bulk upload an ntriples-like
 file or perhaps a large JSON data blob via the REST interface as a
 single transaction would be incredibly helpful.  Consider this a feature
 request.  Thanks for your work on this!

 Cheers.
 Kevin

 On 5/20/10 6:14 AM, Jim Webber wrote:
  Hi fellow graph-tastic people,
 
  Allowing a transaction to span multiple requests was ruled out in the
 early version of the REST API. It's a dangerous pattern that allows for
 inadvertent (or even malicious) denial of service.
 
  If we're going to build systems that sympathetic to the Web, then
 exposing transactions like this is not the way to go.
 
  Having said that, the REST API will need more functionality and that new
 functionality will need to address transactionality, but it will need to do
 so in a way that doesn't compromise its Web-iness. Rick's response is one
 approach, where a transaction is modelled as a resource; another approach
 might be to submit a transactional workflow through the API and get a
 result graph/set back.
 
  I promise I'll do some work on the API again soon. So start yelling your
 requirements and I'll prioritise them (and will ignore the ones that are too
 hard for me to implement, naturally :-)
 
  Jim
  ___
  Neo mailing list
  User@lists.neo4j.org
  https://lists.neo4j.org/mailman/listinfo/user
 

 --
 Kevin Raison
 Founder, CTO

 Chatsubo.net, LLC
 9708 1st Ave NW
 Seattle, WA 98117
 rai...@chatsubo.net

 ph: +1 (206) 801-5728
 fx: +1 (206) 801-5729
 ___
 Neo mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user




-- 
Tobias Ivarsson tobias.ivars...@neotechnology.com
Hacker, Neo Technology
www.neotechnology.com
Cellphone: +46 706 534857
___
Neo mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


Re: [Neo] Transactions in Neo4j REST Server

2010-05-20 Thread Rick Bullotta
Sounds a lot like code ;-)

Rick

-Original Message-
From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On
Behalf Of Tobias Ivarsson
Sent: Thursday, May 20, 2010 2:55 PM
To: Neo user discussions
Subject: Re: [Neo] Transactions in Neo4j REST Server

Hi buddies!

My vote is for adding support for posting a batch of operations to be
executed within the context of one transaction. What we need to figure out
is how these should be expressed. Starting from a list of requirements is
usually a good idea. The features I can think of that the batch operations
should be able to do is:
* Create nodes
* Create relationships
* Assign/update/remove properties
* Verify assumptions

The verification of assumptions is the trickiest part. The easies way I can
think of for doing this is to have the client read all interesting state
using the current API, then build a set of operations to post to the server,
including a set of pre-conditions that need to validate for the transaction
to be executed. If the operations fail the response will contain the failing
conditions and the client can either drop the request or create a new
request, either from scratch or based on the previous one and the
information about the failing conditions.

It might be more useful though to allow the operations to read state and
decide on actions based on that. But supporting that is much harder, the
set of operations is starting to approach a script in some programming
language at that point.

Like dr Webber I believe that allowing for client side (explicit)
transaction management will lead to resource starvation.

Just the thoughts I've been having around this, WDYT?

Cheers,
Tobias

On Thu, May 20, 2010 at 5:51 PM, Kevin Raison rai...@chatsubo.net wrote:

 I am in a situation where being able to bulk upload an ntriples-like
 file or perhaps a large JSON data blob via the REST interface as a
 single transaction would be incredibly helpful.  Consider this a feature
 request.  Thanks for your work on this!

 Cheers.
 Kevin

 On 5/20/10 6:14 AM, Jim Webber wrote:
  Hi fellow graph-tastic people,
 
  Allowing a transaction to span multiple requests was ruled out in the
 early version of the REST API. It's a dangerous pattern that allows for
 inadvertent (or even malicious) denial of service.
 
  If we're going to build systems that sympathetic to the Web, then
 exposing transactions like this is not the way to go.
 
  Having said that, the REST API will need more functionality and that new
 functionality will need to address transactionality, but it will need to
do
 so in a way that doesn't compromise its Web-iness. Rick's response is one
 approach, where a transaction is modelled as a resource; another approach
 might be to submit a transactional workflow through the API and get a
 result graph/set back.
 
  I promise I'll do some work on the API again soon. So start yelling your
 requirements and I'll prioritise them (and will ignore the ones that are
too
 hard for me to implement, naturally :-)
 
  Jim
  ___
  Neo mailing list
  User@lists.neo4j.org
  https://lists.neo4j.org/mailman/listinfo/user
 

 --
 Kevin Raison
 Founder, CTO

 Chatsubo.net, LLC
 9708 1st Ave NW
 Seattle, WA 98117
 rai...@chatsubo.net

 ph: +1 (206) 801-5728
 fx: +1 (206) 801-5729
 ___
 Neo mailing list
 User@lists.neo4j.org
 https://lists.neo4j.org/mailman/listinfo/user




-- 
Tobias Ivarsson tobias.ivars...@neotechnology.com
Hacker, Neo Technology
www.neotechnology.com
Cellphone: +46 706 534857
___
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] Transactions in Neo4j REST Server

2010-05-20 Thread Tobias Ivarsson
It does, doesn't it ;-)

And I'm trying to keep the code as simple as possible...

.. because for really complex things I think that uploading real code to the
server and mount it on a separate URI in the REST server would be more
efficient ...

-tobias

On Thu, May 20, 2010 at 9:05 PM, Rick Bullotta 
rick.bullo...@burningskysoftware.com wrote:

 Sounds a lot like code ;-)

 Rick

 -Original Message-
 From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org]
 On
 Behalf Of Tobias Ivarsson
 Sent: Thursday, May 20, 2010 2:55 PM
 To: Neo user discussions
 Subject: Re: [Neo] Transactions in Neo4j REST Server

 Hi buddies!

 My vote is for adding support for posting a batch of operations to be
 executed within the context of one transaction. What we need to figure out
 is how these should be expressed. Starting from a list of requirements is
 usually a good idea. The features I can think of that the batch operations
 should be able to do is:
 * Create nodes
 * Create relationships
 * Assign/update/remove properties
 * Verify assumptions

 The verification of assumptions is the trickiest part. The easies way I can
 think of for doing this is to have the client read all interesting state
 using the current API, then build a set of operations to post to the
 server,
 including a set of pre-conditions that need to validate for the transaction
 to be executed. If the operations fail the response will contain the
 failing
 conditions and the client can either drop the request or create a new
 request, either from scratch or based on the previous one and the
 information about the failing conditions.

 It might be more useful though to allow the operations to read state and
 decide on actions based on that. But supporting that is much harder, the
 set of operations is starting to approach a script in some programming
 language at that point.

 Like dr Webber I believe that allowing for client side (explicit)
 transaction management will lead to resource starvation.

 Just the thoughts I've been having around this, WDYT?

 Cheers,
 Tobias

 On Thu, May 20, 2010 at 5:51 PM, Kevin Raison rai...@chatsubo.net wrote:

  I am in a situation where being able to bulk upload an ntriples-like
  file or perhaps a large JSON data blob via the REST interface as a
  single transaction would be incredibly helpful.  Consider this a feature
  request.  Thanks for your work on this!
 
  Cheers.
  Kevin
 
  On 5/20/10 6:14 AM, Jim Webber wrote:
   Hi fellow graph-tastic people,
  
   Allowing a transaction to span multiple requests was ruled out in the
  early version of the REST API. It's a dangerous pattern that allows for
  inadvertent (or even malicious) denial of service.
  
   If we're going to build systems that sympathetic to the Web, then
  exposing transactions like this is not the way to go.
  
   Having said that, the REST API will need more functionality and that
 new
  functionality will need to address transactionality, but it will need to
 do
  so in a way that doesn't compromise its Web-iness. Rick's response is one
  approach, where a transaction is modelled as a resource; another approach
  might be to submit a transactional workflow through the API and get a
  result graph/set back.
  
   I promise I'll do some work on the API again soon. So start yelling
 your
  requirements and I'll prioritise them (and will ignore the ones that are
 too
  hard for me to implement, naturally :-)
  
   Jim
   ___
   Neo mailing list
   User@lists.neo4j.org
   https://lists.neo4j.org/mailman/listinfo/user
  
 
  --
  Kevin Raison
  Founder, CTO
 
  Chatsubo.net, LLC
  9708 1st Ave NW
  Seattle, WA 98117
  rai...@chatsubo.net
 
  ph: +1 (206) 801-5728
  fx: +1 (206) 801-5729
  ___
  Neo mailing list
  User@lists.neo4j.org
  https://lists.neo4j.org/mailman/listinfo/user
 



 --
 Tobias Ivarsson tobias.ivars...@neotechnology.com
 Hacker, Neo Technology
 www.neotechnology.com
 Cellphone: +46 706 534857
 ___
 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




-- 
Tobias Ivarsson tobias.ivars...@neotechnology.com
Hacker, Neo Technology
www.neotechnology.com
Cellphone: +46 706 534857
___
Neo mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user


[Neo] Transactions in Neo4j REST Server

2010-05-19 Thread Javier de la Rosa
Hi all,

I think there's no way to perform a transaction through Neo4j REST
Server. It would be great if we could emulate this behaviour using the
header Keep-Alive, some session variable or some persistence issue.
A good option can be the next (I'm guessing Neo4j isn't able to manage
several transactions simultaniously, but I don't really know):
Create transaction
POST /transaction

Example using curl
$ curl -H Accept:application/json -X POST http://localhost:/transaction

Response
201: OK, a transaction was created
409: Transaction already in progress

Since that moment, whatever you do will be under the transaction. When
you finish the transaction. the DELETE verb has to be invoked over
/transaction:
DELETE /transaction

Example using curl
$ curl -X DELETE http://localhost:/transaction

Response
204: OK, no content returned
404: Transaction not found

What do you think about this? Is it too many complicated? Is it possible?

Best regards.



-- 
Javier de la Rosa
___
Neo mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user