[keycloak-user] You cannot set autocommit during a managed transaction

Daan Zwaenepoel dz at scoutsengidsenvlaanderen.be
Mon Feb 26 08:56:37 EST 2018



Hello Everyone

In our keycloak project we are using a external database in combination 
with the keycloak database.
In our Registration formaction I need to get  some data form the 
external database and also write some data back.

Here for I create a entity manger in my Registration factory and I know 
that my connection works because I successfully get data from the 
database but every time I try to write data back ( 
entityManager.getTransaction().begin(); entityManager.merge(lid); 
entityManager.getTransaction().commit();) to the database I get the 
error "You cannot set autocommit during a managed transaction".

When I use entityManager.merge(lid); entityManager.flush(); to write 
data back I get the error " 
javax.persistence.TransactionRequiredException: no transaction is in 
progress".


What is the problem here or what is the best way to write data to the 
database.

  Daan






	
	
	
	









More information about the keycloak-user mailing list