I have failed to resolve this and have raised a question over on
SO:
http://stackoverflow.com/questions/25603163/neo4j-cypher-merge-query-isolation-level
M
On Friday, 29 August 2014 19:56:14 UTC+1, Mark Findlater wrote:
>
> I understand, and I have corrected that. Unfortunately I still have the
> issue, but if this is feature complete I will work on it some more and
> failing to find a solution I will ask the question over on SO. For
> completeness my Index is created like this:
>
> CREATE CONSTRAINT ON (n:`UniqueId`) ASSERT n.`type` IS UNIQUE
>
> And the debug logs now show the below, note that thread 5 and 6 are both
> returning the uid '3'.
>
> Thread-6 DEBUG jta.JtaTransactionManager - Creating new transaction with
> name [null]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT
> Thread-3 DEBUG jta.JtaTransactionManager - Creating new transaction with
> name [null]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT
> Thread-5 DEBUG jta.JtaTransactionManager - Creating new transaction with
> name [null]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT
> Thread-4 DEBUG jta.JtaTransactionManager - Creating new transaction with
> name [null]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT
> Thread-7 DEBUG jta.JtaTransactionManager - Creating new transaction with
> name [null]: PROPAGATION_REQUIRED,ISOLATION_DEFAULT
> Thread-6 DEBUG query.CypherQueryEngineImpl - Executing cypher query: MERGE
> (nid:UniqueId{type:{0}}) ON CREATE SET nid:_UniqueId, nid.count = 1 ON
> MATCH SET nid.count = nid.count + 1 RETURN nid.count params {0=Order}
> Thread-7 DEBUG query.CypherQueryEngineImpl - Executing cypher query: MERGE
> (nid:UniqueId{type:{0}}) ON CREATE SET nid:_UniqueId, nid.count = 1 ON
> MATCH SET nid.count = nid.count + 1 RETURN nid.count params {0=Order}
> Thread-5 DEBUG query.CypherQueryEngineImpl - Executing cypher query: MERGE
> (nid:UniqueId{type:{0}}) ON CREATE SET nid:_UniqueId, nid.count = 1 ON
> MATCH SET nid.count = nid.count + 1 RETURN nid.count params {0=Order}
> Thread-3 DEBUG query.CypherQueryEngineImpl - Executing cypher query: MERGE
> (nid:UniqueId{type:{0}}) ON CREATE SET nid:_UniqueId, nid.count = 1 ON
> MATCH SET nid.count = nid.count + 1 RETURN nid.count params {0=Order}
> Thread-4 DEBUG query.CypherQueryEngineImpl - Executing cypher query: MERGE
> (nid:UniqueId{type:{0}}) ON CREATE SET nid:_UniqueId, nid.count = 1 ON
> MATCH SET nid.count = nid.count + 1 RETURN nid.count params {0=Order}
> Thread-3 DEBUG jta.JtaTransactionManager - Initiating transaction commit
> 1
> Thread-7 DEBUG jta.JtaTransactionManager - Initiating transaction commit
> 2
> Thread-5 DEBUG jta.JtaTransactionManager - Initiating transaction commit
> 3
> Thread-6 DEBUG jta.JtaTransactionManager - Initiating transaction commit
> 3
> Thread-4 DEBUG jta.JtaTransactionManager - Initiating transaction commit
> 4
>
> Thank you for your help in correcting the syntax,
>
> M
>
> On Friday, 29 August 2014 18:14:53 UTC+1, Michael Hunger wrote:
>>
>> Currently your merge op uses two labels :UniqueId and :_UniqueId
>>
>> Merge only supports guarantees for one label one prop
>>
>> You can set the secon label in on create
>>
>> Sent from mobile device
>>
>> Am 29.08.2014 um 16:30 schrieb Mark Findlater <[email protected]
>> >:
>>
>> Thanks Michael.
>>
>> Sorry I should have been more clear, there is already a Unique constraint
>> on the 'type' property. What do you mean by "And only the label from the
>> constraint"?
>>
>>
>> On Friday, 29 August 2014 15:25:35 UTC+1, Michael Hunger wrote:
>>>
>>> You need a unique constraint for this to work
>>>
>>> And only the label from the constraint
>>>
>>>
>>>
>>> Sent from mobile device
>>>
>>> Am 29.08.2014 um 15:36 schrieb Mark Findlater <[email protected]
>>> >:
>>>
>>> Using Neo4J embedded version 2.1.3 and Spring Data Neo4J 3.1.4.RELEASE
>>> and seeing odd behaviour when calling MERGE from multiple threads. Is it
>>> expected that concurrent merge operations (with the same values) will
>>> result in a single unique node and will operations that use the ON CREATE
>>> and ON MATCH constructs acquire a write lock on that node?
>>>
>>> The last comment from Andres Taylor on the documentation for 2.0
>>> <http://docs.neo4j.org/chunked/2.0.0/query-merge.html> suggest that it
>>> should all be complete by now.
>>>
>>> I am seeing an issue with this query where multiple concurrent calls
>>> return the same value.
>>>
>>> MERGE (nid:UniqueId:_UniqueId{type:{0}})
>>> ON CREATE SET nid.count = 1
>>> ON MATCH SET nid.count = nid.count + 1
>>> RETURN nid.count
>>>
>>> There is a label index on the type property.
>>>
>>> I see the same behaviour whether using the Neo4JTemplate or an annotated
>>> Repository method, currently I am getting a deadlock when I try using the
>>> ExecutionEngine directly (looking at this now). I should note that the
>>> deadlock appears to be in the ForsetiClient so the presence of the HA jars
>>> on my classpath may be important.
>>>
>>> --
>>> 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.