At the moment you cannot register listeners for committed nodes or
stuff like that, but you could take a look at the
TransactionEventManager in the "utils" component,
http://components.neo4j.org/neo4j-utils/ . You can use it to register
listeners for events that you send yourself. Your listeners will then
get those events as an array after a successful commit. That's not
really what you asked for though. Another thing would be to register
synchronization hooks on the JTA transactions, however that way you'll
only be notified before and after a transaction is committed, not
_what_ was committed.

If any of those suggestions would be useful I'd be happy to give an
example of such code.

2010/1/14 Raul Raja Martinez <raulr...@gmail.com>:
> Hi Tobias,
>
> At this time we need...
>
>   - Before Transaction Commit
>      - Dirty nodes
>      - Properties
>      - Relationships
>   - After Transaction Commit
>      - Committed Nodes
>      - Properties
>      - Relationships
>
> I can see how other events would be useful such as property set, removed,
> changed...
>
> I think I'd be great if none of these are actually evaluated, stored or
> processed unless there are listeners expecting to be notified.
> Also we need to understand the scope of getting notified by such events in
> the context of HA where the event may be trigger in a server in the cluster
> or in all of them at once if the transactions are distributed.
>
> Thanks!
>
> 2010/1/14 Raul Raja Martinez <raulr...@gmail.com>:
>> Hi Tobias, thanks for the info!
>> I'm gonna consult with my team and we'll get back with some suggestions.
>>
>> 2010/1/14 Tobias Ivarsson <tobias.ivars...@neotechnology.com>:
>>> Hi Raul!
>>>
>>> Yes, Neo4j has such functionality, but we have not specified the final
> API
>>> for it yet. There is code implementing it from an old API that we used in
>>> house back when Neo4j was young. I don't know if all functionality of it
> is
>>> still hooked up though, and it is of course undocumented. If you look in
> the
>>> org.neo4j.kernel.impl.event package of the Neo4j kernel component there
> is
>>> the current code for it. It is highly volatile and likely only work with
> the
>>> current (1.0-rc) and next (1.0) release, since a public event framework
> is
>>> planned for the release after that (1.1).
>>>
>>> Since the proper event API isn't done yet, it is still possible to come
> with
>>> suggestions to how you would want it to work. Do you want events to be
> fired
>>> just before commit or just after? Or perhaps hooks for both? What data
> would
>>> you want access to in the event callback? Do you want a coarse grained
>>> events (commit, rollback) or fine grained events (node_created,
>>> node_property_set, relationship_created, ...)? Ideas are welcome!
>>>
>>> Cheers,
>>> Tobias
>>>
>>> On Thu, Jan 14, 2010 at 1:32 AM, Raul Raja Martinez <raulr...@gmail.com
>>wrote:
>>>
>>>> Hi,
>>>>
>>>> Does neo4j provide some way for adding listeners to the transaction
>>>> lifecycle?
>>>> We would like to intercept when transacions are commited, created and
>>>> rolledback to provide our own functionality
>>>> for example ensure that a given node property is always set or some
>>>> other properties are within a range.
>>>> Most ORM solutions like hibernate allow devs to register to events in
>>>> the system to which they can react when certain events are triggered.
>>>> We need such functionality in general for Traversers, Transactions,
>>>> Inserts, Updates, Cache etc...
>>>> _______________________________________________
>>>> 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
>>>
>>
>>
>>
>> --
>> Raul Raja
>>
>
>
>
> --
> Raul Raja
> _______________________________________________
> Neo mailing list
> User@lists.neo4j.org
> https://lists.neo4j.org/mailman/listinfo/user
>



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

Reply via email to