Antonis,

Just committed some bug fixes in the event framework and hopefully
this also solves the problem you experienced when using Spring. Could
you please try the latest neo4j-kernel 1.1-SNAPSHOT to see if it
works?

To answer your other question the handler is called in the same thread
and you can access node properties in the afterCommit() call (we
changed so reads without a running transaction are possible).

Regards,
Johan

On Thu, May 20, 2010 at 2:56 PM, Antonis Lempesis <ant...@di.uoa.gr> wrote:
> To further clarify, I run 2 tests. In the first test, my objects were
> configured using spring + I had the @Transactional
> annotation in the test method. In the second test, I configured the same
> objects manually and also started and
> commited the transaction before and after calling the test method. In
> both cases, my handler got a TransactionData
> object (not null), but in the second case
> tData.assignedNodeProperties().hasNext() returned true while in the first
> it returned false.
>
> thanks for your support,
> Antonis
>
> PS 2 questions: is the handler called in a different thread? And, in
> afterCommit() method, can I access the node properties
> in the TransactionData object? Since the transaction is commited (I
> guess finished), shouldn't I get an "NotInTransaction"
> exception?
>
> On 5/20/10 3:38 PM, Johan Svensson wrote:
>> Hi,
>>
>> I have not tried to reproduce this but just looking at the code I
>> think it is a bug so thanks for reporting it!
>>
>> The "synchronization hook" that gathers the transaction data gets
>> registered in the call to GraphDatabaseService.beginTx() but when
>> using Spring (with that configuration) UserTransaction (old JTA) will
>> be called directly so no events will be collected.
>>
>> Will fix this very soon.
>>
>> -Johan
>>
>> On Wed, May 19, 2010 at 5:49 PM, Antonis Lempesis<ant...@di.uoa.gr>  wrote:
>>
>>> Hello all,
>>>
>>>    I have set up spring to handle transactions for neo4j (according to
>>> the imdb example) and it works fine. When
>>> I read about the new events framework, I checked out the latest revision
>>> (4421) and tried to register my
>>> TransactionEventHandler that simply prints the number of created nodes.
>>> The weird thing is that when I test
>>> this in a simple junit test case, the TransactionData I get contains the
>>> correct data. When I do the same thing
>>> using the spring configuration, the TransactionData is empty. Any ideas?
>>>
>>> Thanks,
>>> Antonis
_______________________________________________
Neo4j mailing list
User@lists.neo4j.org
https://lists.neo4j.org/mailman/listinfo/user

Reply via email to