aspose file tools*
The moose likes Object Relational Mapping and the fly likes Error: Active Spring transaction synchronization required Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Error: Active Spring transaction synchronization required" Watch "Error: Active Spring transaction synchronization required" New topic
Author

Error: Active Spring transaction synchronization required

Vijay Vishwanath
Greenhorn

Joined: Apr 18, 2007
Posts: 7
Hello all,

I'm getting this error when i try to write a clob to the DB.

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.LobCreatorUtils.registerTransactionSynchronization(LobCreatorUtils.java:79)
at org.springframework.orm.hibernate3.support.AbstractLobType.nullSafeSet(AbstractLobType.java:185)
at org.hibernate.type.CustomType.nullSafeSet(CustomType.java:146)
at org.hibernate.persister.entity.AbstractEntityPersister.dehydrate(AbstractEntityPersister.java:1997)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2243)
at org.hibernate.persister.entity.AbstractEntityPersister.insert(AbstractEntityPersister.java:2660)
at org.hibernate.action.EntityInsertAction.execute(EntityInsertAction.java:56)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:250)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:234)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:141)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:298)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:27)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1000)
at org.springframework.orm.hibernate3.HibernateAccessor.flushIfNecessary(HibernateAccessor.java:390)
at org.springframework.orm.hibernate3.HibernateTemplate.execute(HibernateTemplate.java:373)
at org.springframework.orm.hibernate3.HibernateTemplate.saveOrUpdate(HibernateTemplate.java:686)
at bgc.sfe.dao.impl.SampleClobDAOImpl.saveSampleClob(SampleClobDAOImpl.java:25)
at bgc.sfe.service.impl.ClobManagerImpl.saveSampleClob(ClobManagerImpl.java:24)
at bgc.sfe.client.CategoryTest.main(CategoryTest.java:77)

The source and mapping files are:














Am I not giving some info in the applicationcontext.xml file.
Please help me resolve this problem.
Thanks in Advance.
[ July 23, 2007: Message edited by: Vijay Vishwanath ]
Vijay Vishwanath
Greenhorn

Joined: Apr 18, 2007
Posts: 7
I have removed the clob column from the mapping file and then
tried inserting the record with just two fields (id and name) and
it worked fine, i get the problem only when I try to
insert the clob into the DB.
Can anyone help me resolve this problem?
thanks in advance.
 
 
subject: Error: Active Spring transaction synchronization required