-
Bug
-
Resolution: Done
-
Minor
-
PLINK_2.6.0.Final, PLINK_2.7.0.CR1
-
None
Im using JPA with BasicModel. Whenever I try to use identityManager.update() the changes are not persisted on Database.
However, using entityManager.merge() works, when doing it manually on entities.
Flushing the entitymanager after identityManager.update() does not help either.
@ApplicationScoped public class IdmConfiguration { @Inject private EntityManagerContextInitializer contextInitializer; @PicketLink @Produces public PartitionManager producePartitionManager() { IdentityConfigurationBuilder builder = new IdentityConfigurationBuilder(); builder.named("default") .stores() .jpa() .mappedEntity(AccountTypeEntity.class, RoleTypeEntity.class, GroupTypeEntity.class, IdentityTypeEntity.class, RelationshipTypeEntity.class, RelationshipIdentityTypeEntity.class, PartitionTypeEntity.class, PasswordCredentialTypeEntity.class, DigestCredentialTypeEntity.class, X509CredentialTypeEntity.class, OTPCredentialTypeEntity.class, AttributeTypeEntity.class, PermissionTypeEntity.class) .addContextInitializer(this.contextInitializer) .supportAllFeatures(); return new DefaultPartitionManager(builder.buildAll()); } }
Persistence:
<?xml version="1.0" encoding="UTF-8"?> <persistence version="2.1" xmlns="http://xmlns.jcp.org/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://www.oracle.com/webfolder/technetwork/jsc/xml/ns/persistence/persistence_2_1.xsd"> <persistence-unit name="${persistence.unit}" transaction-type="JTA"> <jta-data-source>${jta-data-source}</jta-data-source> <!-- Picketlink --> <class>org.picketlink.idm.jpa.model.sample.simple.AbstractCredentialTypeEntity</class> <class>org.picketlink.idm.jpa.model.sample.simple.AccountTypeEntity</class> <class>org.picketlink.idm.jpa.model.sample.simple.AttributedTypeEntity</class> <class>org.picketlink.idm.jpa.model.sample.simple.AttributeTypeEntity</class> <class>org.picketlink.idm.jpa.model.sample.simple.DigestCredentialTypeEntity</class> <class>org.picketlink.idm.jpa.model.sample.simple.GroupTypeEntity</class> <class>org.picketlink.idm.jpa.model.sample.simple.IdentityTypeEntity</class> <class>org.picketlink.idm.jpa.model.sample.simple.OTPCredentialTypeEntity</class> <class>org.picketlink.idm.jpa.model.sample.simple.PartitionTypeEntity</class> <class>org.picketlink.idm.jpa.model.sample.simple.PasswordCredentialTypeEntity</class> <class>org.picketlink.idm.jpa.model.sample.simple.RelationshipIdentityTypeEntity</class> <class>org.picketlink.idm.jpa.model.sample.simple.RelationshipTypeEntity</class> <class>org.picketlink.idm.jpa.model.sample.simple.RoleTypeEntity</class> <class>org.picketlink.idm.jpa.model.sample.simple.TokenCredentialTypeEntity</class> <class>org.picketlink.idm.jpa.model.sample.simple.X509CredentialTypeEntity</class> <class>org.picketlink.idm.jpa.model.sample.simple.PermissionTypeEntity</class> <properties> <property name="eclipselink.target-server" value="org.eclipse.persistence.platform.server.glassfish.GlassfishPlatform" /> <property name="eclipselink.target-database" value="${persistence.eclipselink.target-database}" /> <property name="eclipselink.ddl-generation" value="${persistence.eclipselink.ddl-generation}" /> <property name="eclipselink.ddl-generation.output-mode" value="${persistence.eclipselink.ddl-generation.output-mode}" /> <property name="eclipselink.create-ddl-jdbc-file-name" value="create.sql" /> <property name="eclipselink.drop-ddl-jdbc-file-name" value="drop.sql" /> <!-- Default true (to enable lazyloading of LOB) --> <property name="eclipselink.weaving" value="static" /> <property name="eclipselink.logging.level" value="WARNING" /> <property name="eclipselink.logging.level.sql" value="FINE" /> <property name="eclipselink.logging.parameters" value="true" /> <property name="eclipselink.create-ddl-jdbc-file-name" value="createDDL_ddlGeneration.jdbc" /> <property name="eclipselink.drop-ddl-jdbc-file-name" value="dropDDL_ddlGeneration.jdbc" /> </properties> </persistence-unit> </persistence>