Announcement Announcement Module
No announcement yet.
@Transactional and RMI Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • @Transactional and RMI

    Hi everyone,

    I am trying to use Spring's transaction support using the above annotation on an existing project (we are trying to migrate to Spring). The method I am trying to make transactional lives in an object that is going to be exported through RMI and I am getting this Exception:

    java.rmi.UnmarshalException: error unmarshalling return; nested exception is: writing aborted;
    My class declaration (I think the method itself is not that important here):

    public class TagCount extends UnicastRemoteObject
    For completion the transaction part of my appContext configuration:

    <tx:annotation-driven />
    <bean id="transactionManager"
    	<property name="sessionFactory" ref="sessionFactory" />
    My question is, if it is possible to use @Transactional for RMI exported objects in general or if I am using it in a wrong way somehow? As we are working on existing code the object is exported to RMI manually - would using RmiServiceExporter make a difference? I would think so as one wouldn't need to extend any Remote classes, right? Though switching to Spring managed RMI would involve a lot of code changes for us.

    Thanks in advance for any hints and help!