Michael's guess is correct, there is a bug in the *Session.execute* method:

https://github.com/nigelsmall/py2neo/blob/feature/bindable/py2neo/cypher.py#L153

Here, the call should be made to *commit* instead of *execute*.

I suggest that you use the longer form of *append* and *commit* until this
bug is fixed. Examples can be seen on this page:

http://book.py2neo.org/en/latest/cypher/

Nigel


On 21 May 2014 14:15, Александр Богданов <[email protected]> wrote:

> I'm sorry, but I cant understand what logs you mean?
> It's web application.
> In neo4j folder i can't see any requests log. Where to find it? o-o
>
> Thank you.
>
> среда, 21 мая 2014 г., 16:22:31 UTC+4 пользователь Michael Hunger написал:
>>
>> Not sure how py2neo does it internally with these statements, but I think
>> you still have to commit your query.
>>
>> According to the docs it commits immediately, but perhaps there is a bug,
>> so that the node goes away after tx-timeout?
>>
>> Could you produce an http log of the http requests between your python
>> client and the server including responses and http requests and response
>> headers?
>>
>> Thanks
>>
>>
>>
>>
>> On Wed, May 21, 2014 at 1:59 PM, Александр Богданов 
>> <[email protected]>wrote:
>>
>>> Dump!
>>>
>>> All is really stopped without correct working of this... QQ
>>>
>>> понедельник, 19 мая 2014 г., 21:48:43 UTC+4 пользователь Александр
>>> Богданов написал:
>>>
>>>> Sure it's local.
>>>>
>>>> look what happen:
>>>>
>>>> 1. graph before query: http://i.gyazo.com/85df
>>>> bc3152117cd50334085b9b9254b5.png
>>>> 2. running example script: http://i.gyazo.com/034
>>>> 27e0161a3168cbc62915ab1d5ffb9.png
>>>> 3. graph after query (new node selected. can see that it is not
>>>> correct): http://i.gyazo.com/84c62a9a39eca3e7d3dec3fe5dd623ff.png
>>>>
>>>> after several minutes "gray" node disappear
>>>>
>>>> понедельник, 19 мая 2014 г., 21:01:42 UTC+4 пользователь Nigel Small
>>>> написал:
>>>>>
>>>>> Bear in mind that the identifier 'n' is local to that query only and
>>>>> will not automagically find the node called 'n' in the previous create
>>>>> statement. You will need to match by ID or some other indexed criteria.
>>>>> On 19 May 2014 17:10, "Александр Богданов" <[email protected]>
>>>>> wrote:
>>>>>
>>>>>> I tried with RETURN. It returns Node. Correct node. But no node in
>>>>>> database.
>>>>>> Interesting fact. When I trying to find this node using browser *MATCH
>>>>>> n WHERE ID(n)=11880* (id from return) it finds one node. But node is
>>>>>> without any property or label and colored lightgrey. But no such node in
>>>>>> answer on *MATCH n RETURN n. *And after restarting Neo4j even
>>>>>> looking with ID unsuccessful.
>>>>>>
>>>>>> понедельник, 19 мая 2014 г., 19:55:15 UTC+4 пользователь Nigel Small
>>>>>> написал:
>>>>>>>
>>>>>>> You won't see any return values from your Cypher unless you include
>>>>>>> a "RETURN n" clause at the end of your statement. This is probably your
>>>>>>> problem here.
>>>>>>>
>>>>>>> On a side note, I'd strongly advise again that you do not use %
>>>>>>> substitution and use Cypher parameters instead. You will hit problems 
>>>>>>> with
>>>>>>> unescaped characters at some point otherwise.
>>>>>>>
>>>>>>> Nige
>>>>>>>
>>>>>>>
>>>>>>> On 19 May 2014 16:45, Александр Богданов <[email protected]>wrote:
>>>>>>>
>>>>>>>> *query("CREATE (n:person {name:'%s', nickname:'%s', md5:'%s'})" %
>>>>>>>> (name, nickname, hashlib.md5(password).hexdigest()))*
>>>>>>>>
>>>>>>>> query() definition:
>>>>>>>>
>>>>>>>> *class CypherQuery:*
>>>>>>>> *    def __init__(self, service):*
>>>>>>>> *        self.session = cypher.Session(service)*
>>>>>>>> *    def cypher_q(self, input, count=1):*
>>>>>>>> *        if count == 1:*
>>>>>>>> *            return [x.values[0] for x in
>>>>>>>> self.session.execute(input)]*
>>>>>>>> *        else:*
>>>>>>>> *            return [x.values for x in self.session.execute(input)]
>>>>>>>>    *
>>>>>>>>
>>>>>>>> *CQ = CypherQuery('http://localhost:7474 <http://localhost:7474>')*
>>>>>>>> *query = CQ.cypher_q*
>>>>>>>>
>>>>>>>>
>>>>>>>> понедельник, 19 мая 2014 г., 18:26:55 UTC+4 пользователь Nigel
>>>>>>>> Small написал:
>>>>>>>>>
>>>>>>>>> Could you post a section of Python code that includes a CREATE
>>>>>>>>> statement that fails for you?
>>>>>>>>>
>>>>>>>>> Incidentally, you would be better off using Cypher parameters
>>>>>>>>> (passed in the *execute* method) than the Python level %
>>>>>>>>> substitution you have here. This will improve both performance and
>>>>>>>>> reliability with "odd" characters. On this subject, do your properties
>>>>>>>>> contain ' marks? This could be breaking the query.
>>>>>>>>>
>>>>>>>>> Nige
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> On 19 May 2014 15:04, Александр Богданов <[email protected]>wrote:
>>>>>>>>>
>>>>>>>>>> *CREATE (n:person {name:'%s', nickname:'%s', md5:'%s'})*
>>>>>>>>>> %s - strings
>>>>>>>>>>
>>>>>>>>>> воскресенье, 18 мая 2014 г., 15:39:45 UTC+4 пользователь Michael
>>>>>>>>>> Hunger написал:
>>>>>>>>>>>
>>>>>>>>>>> Can you show your delete and create statements?
>>>>>>>>>>>
>>>>>>>>>>> You should probably also use parameters for your id *WHERE
>>>>>>>>>>> ID(p)={id}*
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> On Sat, May 17, 2014 at 3:31 PM, Александр Богданов <
>>>>>>>>>>> [email protected]> wrote:
>>>>>>>>>>>
>>>>>>>>>>>> Hello.
>>>>>>>>>>>>
>>>>>>>>>>>> Problems with writing to database from python script.
>>>>>>>>>>>>
>>>>>>>>>>>> Opening session:
>>>>>>>>>>>> *self.session = cypher.Session(http://localhost:7474
>>>>>>>>>>>> <http://localhost:7474>)*
>>>>>>>>>>>>
>>>>>>>>>>>> query like this:
>>>>>>>>>>>>  *self.session.execute("MATCH (p:person)-[:has_a_role]-(role)
>>>>>>>>>>>> WHERE ID(p)=%d RETURN role.role") *
>>>>>>>>>>>> working well. I receiving all information i need.
>>>>>>>>>>>>
>>>>>>>>>>>> but if i trying to create node or delete it doesnt work.
>>>>>>>>>>>> no errors
>>>>>>>>>>>> even correct node in return of execute() function if i trying
>>>>>>>>>>>> to create it. but no such node in response on query like 
>>>>>>>>>>>> *self.session.execute("MATCH
>>>>>>>>>>>> (n) RETURN n")*
>>>>>>>>>>>> and in http://127.0.0.1:7474/browser/ no such node too. but if
>>>>>>>>>>>> i trying in browser - it creates.
>>>>>>>>>>>>
>>>>>>>>>>>> something with configuration? why can't i correctly use
>>>>>>>>>>>> write-queries with *py2neo.cypher.Session.execute()* ?
>>>>>>>>>>>>
>>>>>>>>>>>> PS: Sorry for my english and thank you.
>>>>>>>>>>>>
>>>>>>>>>>>> --
>>>>>>>>>>>> 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/d/optout.
>>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>  --
>>>>>>>>>> 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/d/optout.
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>  --
>>>>>>>> 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/d/optout.
>>>>>>>>
>>>>>>>
>>>>>>>  --
>>>>>> 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/d/optout.
>>>>>>
>>>>>  --
>>> 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/d/optout.
>>>
>>
>>  --
> 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/d/optout.
>

-- 
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/d/optout.

Reply via email to