Re: [Neo4j] how to make rolledback transaction

2011-05-22 Thread Charles Bedon
Hello

This might help you:

http://api.neo4j.org/current/org/neo4j/graphdb/Transaction.html

And I'm not sure if this thread is still valid as reference:

http://www.mail-archive.com/user@lists.neo4j.org/msg03716.html

-
Charles Edward Bedón Cortázar
ITIL Foundation Certified
Open Source Network Inventory for the masses!  http://kuwaiba.sourceforge.net | 
Follow Kuwaiba on Twitter
Linux Registered User #38



 Am Sun, 22 May 2011 00:47:10 -0500 Jose Angel Inda Herrera 
lt;jai...@estudiantes.uci.cugt; schrieb  


hello list 
how to make rolledback a transaction 
thanks 
cheers. 
 
 
___ 
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] Compact JSON format for the server

2011-05-22 Thread Peter Neubauer
Mmh,
How does then the compact parameter work in other Accept headers than
application/json work? Since this is a representation that compacts in
JSON, maybe the subformat is ok anyway?

Otherwise, how do we then name that return-format parameter so it doesn't
get mixed up with other, normal paramters?

Cheers,

/peter neubauer

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   - Your high performance graph database.
http://startupbootcamp.org/- Öresund - Innovation happens HERE.
http://www.thoughtmade.com - Scandinavia's coolest Bring-a-Thing party.


On Sat, May 21, 2011 at 4:00 PM, Ian Robinson iansrobin...@gmail.comwrote:

 Another agreement here. It doesn't even have to be a query parameter - just
 identify the compact variant with a different URI.

 What would be the caching implications if it were a query parameter? Though
 the URI spec says querystring parameters effectively create a new URI, I
 think many caches/reverse proxies will treat

 http://localhost:7474/db/data/node/1?compact=true

 and

 http://localhost:7474/db/data/node/1
 http://localhost:7474/db/data/node/1?compact=true

 as the same URI. Which will mess up caching. I expected a full
 representation, and got back a compact one. Hmmm. May be worth testing with
 e.g. Squid.

 But the main point is: a compact representation belongs to a different
 resource. Identify it through the URI, not an HTTP header.

 ian

 On 21 May 2011 14:02, Rick Bullotta rick.bullo...@thingworx.com wrote:

  Agree with Jim. This fits better as a query parameter vs content type.
 
 
 
 ___
 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] Compact JSON format for the server

2011-05-22 Thread Jim Webber
Hi Peter,

 How does then the compact parameter work in other Accept headers than
 application/json work?

I think Ian's saying it's not to be used in the Accept header. He's saying 
identify the *variant* through a different URI.

 Since this is a representation that compacts in
 JSON, maybe the subformat is ok anyway?

No, I don't think it is. It is JSON - that's how it should be processed. I 
think it's wrong to overload media types in this way.

 Otherwise, how do we then name that return-format parameter so it doesn't
 get mixed up with other, normal paramters?

It's JSON. Just like our normal stuff is JSON. The only processing directive 
we give is application/json and that's true whichever variant is returned. If 
you are a client of Neo4j then you must be prepared to accept either of our 
JSON responses (or HTML or whatever). The same is also true if you abuse the 
media type - it's just that you've pretended one kind of response is different. 

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


Re: [Neo4j] Compact JSON format for the server

2011-05-22 Thread Rick Bullotta
The key here is that the *URI* is the determining factor on the type of 
representation (compact or not), and clearly the client, who will request a 
specific URI, is aware of which type of request has been made.

-Original Message-
From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On 
Behalf Of Jim Webber
Sent: Sunday, May 22, 2011 11:12 AM
To: Neo4j user discussions
Subject: Re: [Neo4j] Compact JSON format for the server

Hi Peter,

 How does then the compact parameter work in other Accept headers than
 application/json work?

I think Ian's saying it's not to be used in the Accept header. He's saying 
identify the *variant* through a different URI.

 Since this is a representation that compacts in
 JSON, maybe the subformat is ok anyway?

No, I don't think it is. It is JSON - that's how it should be processed. I 
think it's wrong to overload media types in this way.

 Otherwise, how do we then name that return-format parameter so it doesn't
 get mixed up with other, normal paramters?

It's JSON. Just like our normal stuff is JSON. The only processing directive 
we give is application/json and that's true whichever variant is returned. If 
you are a client of Neo4j then you must be prepared to accept either of our 
JSON responses (or HTML or whatever). The same is also true if you abuse the 
media type - it's just that you've pretended one kind of response is different. 

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] Compact JSON format for the server

2011-05-22 Thread Peter Neubauer
Ok,
Then all requests should be piped through a filter looking for non - domain,
generic, possibly reserved url parameters like format ? Or is a reserved
url pattern a better way?
On May 22, 2011 5:14 PM, Rick Bullotta rick.bullo...@thingworx.com
wrote:
 The key here is that the *URI* is the determining factor on the type of
representation (compact or not), and clearly the client, who will request a
specific URI, is aware of which type of request has been made.

 -Original Message-
 From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org]
On Behalf Of Jim Webber
 Sent: Sunday, May 22, 2011 11:12 AM
 To: Neo4j user discussions
 Subject: Re: [Neo4j] Compact JSON format for the server

 Hi Peter,

 How does then the compact parameter work in other Accept headers than
 application/json work?

 I think Ian's saying it's not to be used in the Accept header. He's saying
identify the *variant* through a different URI.

 Since this is a representation that compacts in
 JSON, maybe the subformat is ok anyway?

 No, I don't think it is. It is JSON - that's how it should be processed. I
think it's wrong to overload media types in this way.

 Otherwise, how do we then name that return-format parameter so it doesn't
 get mixed up with other, normal paramters?

 It's JSON. Just like our normal stuff is JSON. The only processing
directive we give is application/json and that's true whichever variant is
returned. If you are a client of Neo4j then you must be prepared to accept
either of our JSON responses (or HTML or whatever). The same is also true if
you abuse the media type - it's just that you've pretended one kind of
response is different.

 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] Compact JSON format for the server

2011-05-22 Thread Rick Bullotta
As Jim and Ian have suggested, a URL parameter or a URL pattern would both work.

-Original Message-
From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org] On 
Behalf Of Peter Neubauer
Sent: Sunday, May 22, 2011 11:27 AM
To: Neo4j user discussions
Subject: Re: [Neo4j] Compact JSON format for the server

Ok,
Then all requests should be piped through a filter looking for non - domain,
generic, possibly reserved url parameters like format ? Or is a reserved
url pattern a better way?
On May 22, 2011 5:14 PM, Rick Bullotta rick.bullo...@thingworx.com
wrote:
 The key here is that the *URI* is the determining factor on the type of
representation (compact or not), and clearly the client, who will request a
specific URI, is aware of which type of request has been made.

 -Original Message-
 From: user-boun...@lists.neo4j.org [mailto:user-boun...@lists.neo4j.org]
On Behalf Of Jim Webber
 Sent: Sunday, May 22, 2011 11:12 AM
 To: Neo4j user discussions
 Subject: Re: [Neo4j] Compact JSON format for the server

 Hi Peter,

 How does then the compact parameter work in other Accept headers than
 application/json work?

 I think Ian's saying it's not to be used in the Accept header. He's saying
identify the *variant* through a different URI.

 Since this is a representation that compacts in
 JSON, maybe the subformat is ok anyway?

 No, I don't think it is. It is JSON - that's how it should be processed. I
think it's wrong to overload media types in this way.

 Otherwise, how do we then name that return-format parameter so it doesn't
 get mixed up with other, normal paramters?

 It's JSON. Just like our normal stuff is JSON. The only processing
directive we give is application/json and that's true whichever variant is
returned. If you are a client of Neo4j then you must be prepared to accept
either of our JSON responses (or HTML or whatever). The same is also true if
you abuse the media type - it's just that you've pretended one kind of
response is different.

 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] how to make rolledback transaction

2011-05-22 Thread Mattias Persson
A transaction is typically done like this:

  Transaction tx = graphDb.beginTx();
  try
  {
  // Do stuff
  tx.success();
  }
  finally
  {
  tx.finish();
  }

If you don't want that transaction committed just throw an exception in the
Do stuff block, or don't call tx.success(). You can even use tx.failure()
to mark a transaction to be rolled back in nested transactions, but rarely
used. See more here:

http://docs.neo4j.org/chunked/1.3/transactions-interaction.html
http://wiki.neo4j.org/content/Transactions

2011/5/22 Jose Angel Inda Herrera jai...@estudiantes.uci.cu

 hello list
 how to make rolledback a transaction
 thanks
 cheers.


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




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


Re: [Neo4j] how to make rolledback transaction

2011-05-22 Thread Jose Angel Inda Herrera
El 22/05/11 13:38, Mattias Persson escribió:
 A transaction is typically done like this:

Transaction tx = graphDb.beginTx();
try
{
// Do stuff
tx.success();
}
finally
{
tx.finish();
}

 If you don't want that transaction committed just throw an exception in the
 Do stuff block, or don't call tx.success(). You can even use tx.failure()
 to mark a transaction to be rolled back in nested transactions, but rarely
 used. See more here:

 http://docs.neo4j.org/chunked/1.3/transactions-interaction.html
 http://wiki.neo4j.org/content/Transactions

 2011/5/22 Jose Angel Inda Herrerajai...@estudiantes.uci.cu

 hello list
 how to make rolledback a transaction
 thanks
 cheers.


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



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