Error during usage of orient-spring-tx with ODB(2.x) in embedded mode in an spring application.

45 views
Skip to first unread message

Rohitdev Kulshrestha

unread,
Apr 21, 2015, 4:10:04 PM4/21/15
to orient-...@googlegroups.com
Orient DB version :2.0.5
Spring version:4.1.6.RELEASE
orient-spring-tx:0.3.0

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.

Rohitdev Kulshrestha

unread,
Apr 22, 2015, 11:58:42 AM4/22/15
to orient-...@googlegroups.com
Did anybody else get these issues whlie using Spring?

Rohitdev Kulshrestha

unread,
Apr 22, 2015, 5:29:10 PM4/22/15
to orient-...@googlegroups.com
Wrt to the above issue attaching a sample code base to seek your help

Expecting a positive reply.

Regards,
Rohitdev
TestODBTransactional.zip
Reply all
Reply to author
Forward
0 new messages