| Hi, thanks a lot. Tests shouldn't fail, if you tell me the exception maybe I can help. You will probably only touch the mongoDB project so, for development, the following should work without issues:
mvn clean install -p mongodb -s settings-example.xml
Once that works, In MongoDBTestHelper you can implement the method backendSupportsTransactions like this:
@Override
public boolean backendSupportsTransactions() {
return true;
}
This will enable all the tests in our test suite that check datastores with transaction support. Once you have done that you should see some failure in the maven build. Now you can start to work on the transactions for MongoDB. For an example of transactions, I think you can check the Neo4j module, in particular the classes under the package org.hibernate.ogm.datastore.neo4j.remote.bolt.transaction.impl. The goal is to implement the interface ForwardingTransactionCoordinatorBuilder adding a class MongoDBTransactionCoordinatorBuilder. Then, in MongoDBDatastoreProvider, implements the method getTransactionCoordinatorBuilder and return an instance of the MongoDBTransactionCoordinatorBuilder. You can see an example of this in BoltNeo4jDatastoreProvider. The package org.hibernate.ogm.datastore.neo4j.remote.bolt.transaction.impl contains an example of the classes you need to create. They are the Neo4j ones but you should be able to adapt them for MongoDB. The idea is that we have a transaction coordinator for JTA and one for Resource local and the builder decide which one to use based on the configuration. The transaction coordinator (TransactionCordinator) takes care of starting and stopping transactions. Make sure to keep the code clean and follow the Hibernate guidelines: http://hibernate.org/ogm/contribute/ You can find templates for your IDE here: https://github.com/hibernate/hibernate-ide-codestyles If you need help don't hesitate to ask and you can find us on:
Thanks a lot! |