AnsweredAssumed Answered

Transaction must be active and synchronization is required

Question asked by antonkronseder on Apr 28, 2009
Latest reply on Jun 27, 2014 by robin.clarke
Dear alfresco community,
after migrating from LABS 3.0a to 3.0b,3.0c,3.0d(Final) aka 3.1 and 3.2 Preview aka 3.0e I always have the following Exception.
Btw: everything runs fine with LABS 3.0a and Enterprise 3.0.

I fetch a Ticket by using RESTLET:

Login
GET /alfresco/service/api/login?u={username}&pw={password?}


And use this ticket to e.g create a new site with my own java based webscript:


create a site
POST /alfresco/service/hd/site?shortName={shortName}

create a site by its shortName.

Authentication:   admin
Transaction:   required
Format Style:   extension
Default Format:   json
Id:   de/hdgmbh/site/site.post
Descriptor:   classpath:alfresco/templates/webscripts/de/hdgmbh/site/site.post.desc.xml



Web Script Status 500 - Internal Error

org.alfresco.error.AlfrescoRuntimeException - Transaction must be active and synchronization is required: Thread[http-8181-5,5,main]
org.alfresco.repo.transaction.AlfrescoTransactionSupport.registerSynchronizations(AlfrescoTransactionSupport.java:432)
org.alfresco.repo.transaction.AlfrescoTransactionSupport.getSynchronization(AlfrescoTransactionSupport.java:416)
org.alfresco.repo.transaction.AlfrescoTransactionSupport.getResource(AlfrescoTransactionSupport.java:209)
org.alfresco.repo.domain.hibernate.DirtySessionMethodInterceptor.getFlushData(DirtySessionMethodInterceptor.java:213)org.alfresco.repo.domain.hibernate.DirtySessionMethodInterceptor.invoke(DirtySessionMethodInterceptor.java:354)org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:166)
org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
$Proxy2.getNodePair(Unknown Source)
org.alfresco.repo.node.db.DbNodeServiceImpl.getNodePairNotNull(DbNodeServiceImpl.java:153)


In the webscript desc.xml I tried it with:    
<transaction>required</transaction>
and with
<transaction>requiresnew</transaction>

Any help would be appreciated.

Thanks in advance,

Anton Kronseder

Outcomes