Hi,
Thanks for your reply. I am using JpaTransactionManager:
Code:
<bean id="transactionManager" class="org.springframework.orm.jpa.JpaTransactionManager">
<property name="entityManagerFactory" ref="entityManagerFactory" />
</bean>
<tx:advice id="txAdvice" transaction-manager="transactionManager">
<tx:attributes>
<tx:method name="find*, read*, get*" read-only="true" />
<tx:method name="save, create, delete, remove, update" rollback-for="Throwable" />
<tx:method name="createImmediately"/>
</tx:attributes>
</tx:advice>
<aop:config>
<aop:pointcut id="coreDefaultOperation" expression="execution(* com.walterjwhite.manager.*.*(..))" />
<aop:advisor pointcut-ref="coreDefaultOperation" advice-ref="txAdvice" />
</aop:config>
<!--
Instruct Spring to perform declarative transaction management
automatically on annotated classes.
transaction-manager="transactionManager"
-->
<tx:annotation-driven transaction-manager="transactionManager" />
I configured that in my applicationContext.xml so that certain methods in my manager will have read only transactions and others that perform saves, updates, or deletes will be read/write. I'm not sure entirely how it works, but since the timing was delayed, that is why I made the observation that it must be running in a separate thread which I don't want. I want the methods to be executed in the order I have them written. First save the object, 2 get the id of the object and schedule a job in quartz with that.
Should I use JtaTransactionManager? Eventually, we would like this system to span multiple machines so we'll probably need to switch to that at some point.
Thanks,
Walter