Results 1 to 2 of 2

Thread: SpringSessionSynchronization with JtaTransactionManager

  1. #1
    Join Date
    Jul 2005
    Posts
    5

    Default SpringSessionSynchronization with JtaTransactionManager

    I'm trying to register the SessionFactoryUtil.SpringSessionSynchronization with the JtaTransactionManager I have configured as:

    Code:
    	<bean id="transactionManager" class="org.springframework.transaction.jta.JtaTransactionManager">
    		<property name="userTransactionName">
    			<value>UserTransaction</value>
    		</property>
    	</bean>
    This is because I need full JTA transaction but Hibernate is part of these transactions and I have a problem where the Hibernate Session isn't being flushed before commit.

    Does anyone know how to register the above SpringSessionSynchronization with the JtaTransactionManager in the configuration?

  2. #2
    Join Date
    Jul 2005
    Posts
    5

    Default

    It appears that this has to be done programmatically so I elected to modify some of my code to use the SessionFactoryUtils.getSession() method which will handle registering the correct TransactionSynchronization upon creation of a new Session. I wanted some of the other intelligence built into the SessionFactoryUtils class, otherwise I believe could have also extended the JtaTransactionManager to register the SpringSessionSynchronization upon instantiation.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •