Weblogic 12c with Oracle Database 18c: setTransactionOnly() called on transaction error

I have an Enterprise Application, with some JPA 2.1 entities. I'm reaching the database via a registered JNDI Datasource from WebLogic. The JPA implementation is Hibernate 5.2.17. I'm using Spring Data JPA to ease the database access.

The entity in question:

public class PermissionEntity implements Serializable {
    private static final long serialVersionUID = -3862680194592486778L;

    @Id
    @GeneratedValue
    private Long id;

    @Column(unique = true)
    private String permission;

    @ManyToMany
    private List<RoleEntity> roles;
}

When I'm trying to insert a new entity, I get the following exception from WebLogic: weblogic.transaction.internal.AppSetRollbackOnlyException: setRollbackOnly called on transaction.

This error doesn't happen with other entities. Neither in this, nor in other EARs, while in theory, all the configuration is the same.

Upvotes: 0

Views: 1096

Answers (1)

Saxon
Saxon

Reputation: 937

It might be a constraint violation, or something else. In order to understand the problem set the following flag on your managed server startup parameters:

-Dweblogic.transaction.allowOverrideSetRollbackReason=true

This way you should get an error stack with some more relevant information on the container transaction failure.

Upvotes: 3

Related Questions