I'm trying to use @Transaction annonotaoin interceptpr via Spring(4.x) using the transaction manager provided by
https://ops4j1.jira.com/wiki/display/ORIENT/Spring+Transaction+Manager+Usage
I've used the similar configuration technique as described in the URl above.
I get the following stack trace
Caused by: com.orientechnologies.orient.core.exception.ODatabaseException: Database instance is not set in current thread. Assure to set it with: ODatabaseRecordThreadLocal.INSTANCE.set(db);
at com.orientechnologies.orient.core.db.ODatabaseRecordThreadLocal.get(ODatabaseRecordThreadLocal.java:52)
at org.ops4j.orient.spring.tx.AbstractOrientDatabaseFactory.db(AbstractOrientDatabaseFactory.java:95)
at org.ops4j.orient.spring.tx.OrientObjectDatabaseFactory.db(OrientObjectDatabaseFactory.java:49)
at com.dell.supportassist.persistencemanager.dao.SMTPSettingsDAO.getSMTPSettings(SMTPSettingsDAO.java:51)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:201)
at com.sun.proxy.$Proxy67.getSMTPSettings(Unknown Source)
at com.dell.supportassist.common.smtp.utils.SupportAssistEmailManager.init(SupportAssistEmailManager.java:83)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleElement.invoke(InitDestroyAnnotationBeanPostProcessor.java:349)
at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor$LifecycleMetadata.invokeInitMethods(InitDestroyAnnotationBeanPostProcessor.java:300)
at org.springframework.beans.factory.annotation.InitDestroyAnnotationBeanPostProcessor.postProcessBeforeInitialization(InitDestroyAnnotationBeanPostProcessor.java:133)
... 135 more
I understand normally this gets solved by using connection pooling but the OrientObjectDatabaseFactory internally is creating pools so not sure why this error is coming up.