|How to participate in service transactions? [message #1220310]
||Tue, 10 December 2013 21:34
| Patrick Mackinlay
Registered: December 2013
I understand that all Scout service operations run within a transaction - that is, the framework begins a transaction at the entry of a service operation, and presumably either commit or roll it back at the end of the operation, depending upon any errors that might have been flagged during processing.|
I also understand that the SqlService derivative implementations somehow "hook into" this in order to perform the underlying database operations necessary to implement the behaviour (e.g. executing the underlying database "commit" or "rollback" statements, etc.).
In my case, I'm wanting to implement a new service based on the Neo4j graph database engine (www.neo4j.org), in embedded mode. Neo4j is not an SQL-based database, and I don't believe it would make much sense to try to implement it as a derivative of the SqlService in Scout. I do, however, need to be able to hook into the Scout service transaction mechanism, so that all service operations are automatically wrapped in an underlying Neo4j transaction.
I'm quite lost trying to understand how to go about this - there's nothing obvious I can see to implement on my service to alert Scout that it needs its own transaction implementation logic. Where do I implement the needed transaction calls, and how do I ensure those calls are integrated with Scout's transaction management system?
PS: I'm really unsure, but perhaps if a Neo4j embedded database instance were directly registered as an OSGi service (rather than dealing with it as a library), some kind of JTA or XA magic might automatically perform the above, or is that just wishful thinking?
Powered by FUDForum
. Page generated in 0.02139 seconds