File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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

Error: Active Spring transaction synchronization required

Vijay Vishwanath

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.hibernate.type.CustomType.nullSafeSet(
at org.hibernate.persister.entity.AbstractEntityPersister.dehydrate(
at org.hibernate.persister.entity.AbstractEntityPersister.insert(
at org.hibernate.persister.entity.AbstractEntityPersister.insert(
at org.hibernate.action.EntityInsertAction.execute(
at org.hibernate.engine.ActionQueue.execute(
at org.hibernate.engine.ActionQueue.executeActions(
at org.hibernate.engine.ActionQueue.executeActions(
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(
at org.hibernate.impl.SessionImpl.flush(
at org.springframework.orm.hibernate3.HibernateAccessor.flushIfNecessary(
at org.springframework.orm.hibernate3.HibernateTemplate.execute(
at org.springframework.orm.hibernate3.HibernateTemplate.saveOrUpdate(
at bgc.sfe.dao.impl.SampleClobDAOImpl.saveSampleClob(
at bgc.sfe.service.impl.ClobManagerImpl.saveSampleClob(
at bgc.sfe.client.CategoryTest.main(

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

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.
It is sorta covered in the JavaRanch Style Guide.
subject: Error: Active Spring transaction synchronization required
Similar Threads
Hiberante transaction in Spring
Hibernate insert fails due to generate key failure
I am getting org.springframework.orm.hibernate3.HibernateSystemException: Unknown entity:
Hibernate, Spring and H2
unsatisfied Dependancy exception