Tai,
I also ran into the "merge method is not under a transaction" error. How I
solved it was adding in this chunk of config:
<tx:advice id="txAdvice" transaction-manager="transactionManager">
<tx:attributes>
<tx:method name="delete*" read-only="false"/>
<tx:method name="save*" read-only="false"/>
<tx:method name="update*" read-only="false"/>
<tx:method name="get*" read-only="true"/>
<tx:method name="*" />
</tx:attributes>
</tx:advice>
<aop:config>
<aop:pointcut id="ticketRegistryOperations" expression="execution(*
org.jasig.cas.ticket.registry.JpaTicketRegistry.*(..))"/>
<aop:pointcut id="ticketRegistryLockingOperations"
expression="execution(*
org.jasig.cas.ticket.registry.support.JpaLockingStrategy.*(..))"/>
<aop:advisor advice-ref="txAdvice"
pointcut-ref="ticketRegistryOperations"/>
<aop:advisor advice-ref="txAdvice"
pointcut-ref="ticketRegistryLockingOperations"/>
</aop:config>
Between 4.0 and 4.1 the automatic transactions for the TicketRegistery and
ServiceRegistry was moved from @Transactional annotations to the tx:advice
and aop:config spring xml config.
Hope this helps with your issue Tai.
-Daniel
On Wednesday, December 2, 2015 at 12:15:56 AM UTC-5, Tai Hu wrote:
>
> Do you find the solution for this "No transactional EntityManager
> available" issue? I just ran into the exact same problem. For both
> PostgreSQL and MySQL, merge method is never under a transaction. Thanks.
>
> On Monday, November 30, 2015 at 7:48:05 AM UTC-5, robertoschwald wrote:
>>
>> Hi all,
>>
>> while configuring CAS 4.1.2 with JpaTicketRegistry, I cannot get it to
>> work.
>> I always receive the following Exception:
>> Exception thrown executing
>> org.jasig.cas.web.flow.GenerateServiceTicketAction@6e6a43a4 in state
>> 'generateServiceTicket' of flow 'login'
>> javax.persistence.TransactionRequiredException: No transactional
>> EntityManager available
>> at
>> org.springframework.orm.jpa.SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.invoke(SharedEntityManagerCreator.java:275)
>>
>>
>> at com.sun.proxy.$Proxy49.merge(Unknown Source)
>> at
>> org.jasig.cas.ticket.registry.JpaTicketRegistry.updateTicket(JpaTicketRegistry.java:57)
>>
>>
>>
>>
>> I used the described config in
>> http://jasig.github.io/cas/4.1.x/installation/JPA-Ticket-Registry.html
>> and also added some pointcuts described in
>>
>> http://stackoverflow.com/a/33663812
>>
>> But it still fails.
>>
>> My JPA config is in spring-configuration/ticketRegistry.xml.
>>
>> Anything else I’m missing?
>>
>>
>> Robert
>>
>>
>>
>>
--
You received this message because you are subscribed to the Google Groups "CAS
Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
Visit this group at http://groups.google.com/a/apereo.org/group/cas-user/.