@Inject
EmbeddedObjectContainer oc;
@Override
public PlatformTransactionManager get() {
final Db4oTransactionManager db4oTm = new Db4oTransactionManager(oc);
// set the transaction timeout
final int timeout =
config == null ? DEFAULT_TRANS_TIMEOUT : config.getInt(Db4oConfigKeys.DB_TRANS_TIMEOUT.getKey(),
DEFAULT_TRANS_TIMEOUT);
db4oTm.setDefaultTimeout(timeout);
log.info("Set DB4O default transaction timeout to: " + timeout);
// validate configuration
try {
db4oTm.afterPropertiesSet();
}
catch(final Exception e) {
throw new IllegalStateException(e);
}