Aug 3rd, 2007, 03:58 AM
Hibernate unit testing error with clobs-Active Spring transaction synchronization or
Im trying to unit test the saving of an hibernate objects with clobs in them. I had been having no trouble with any of my other objects until i added the clobs and then I get these errors:
Exception in thread "main" java.lang.IllegalStateException: Active Spring transaction synchronization or active JTA transaction with specified [javax.transaction.TransactionManager] required
at org.springframework.jdbc.support.lob.LobCreatorUti ls.registerTransactionSynchronization(LobCreatorUt ils.java:79)
I'm using the following initialization code at the beginning of the test:
SessionFactory sessionFactory = (SessionFactory) ctx.getBean("sessionFactory");
Session se = sessionFactory.openSession();
TransactionSynchronizationManager.bindResource(ses sionFactory, new SessionHolder(se));
which had been working fine until now.
How do get this working so i can test this?