Problem about Business Data Model with PostgreSQL DB


Hi, everybody

We have a Bonita platform defined with PostgreSQL DB (a main BD and Business Model)..

I've interested in testing the Procurement example, using a BDM. Read data and delete data running success, but when I'll try to insert a new records (new MyObject), appear in the Window Code Inspector the follow error:

exception class org.bonitasoft.engine.exception.BonitaRuntimeException message | org.bonitasoft.engine.persistence.SRetryableException: javax.persistence.PersistenceException: org.hibernate.exception.ConstraintViolationException: could not execute statement

So, the new record it's impossible to insert.

Anyone know the solution ? Is it a trouble ? Sorry, we are using the Bonita BPM CE v7.3.2

Any helps we'll be apreciated.

Best regards.



Submitted by unai.gaston.caminos on Mon, 02/18/2019 - 17:11

Hi Jordi,

From what you describe, I would say the problem lies with the data you are trying to add.

For example, it could be that you are trying to add some value in one of the fileds of MyObject for which a Unique constraint has been defined, and that such value already exists in your BDM.

In order to be able to identify the actual problem, though, it would help if you could share:

  • the whole stack of the error (you can find it in the TOMCAT_HOME/logs/bonita.xxxx-xx-xx.log or JBOSS_HOME/standalone/logs/server.log file)
  • the code where you are trying to insert the data
  • the context in which you are trying to insert the data (is it an external client? a task in a process?...)



Submitted by jordicato on Wed, 02/20/2019 - 20:04

Hi Unai

May be the problem is when Bonita creates the table in PostgreSQL, the PersistenceID field is not auto incress. Is this the problem ?

Many thanks for your request, Unai.

Best regards


Submitted by jordicato on Thu, 02/21/2019 - 14:51

Hi, Unai

I think I have found the trouble, may be a Bonita Platform bug.

I have tried the Suplier process to use H2 database (Business Data Model definition) and the insert record SUPPLIER is good, the persistenceid filed has a column_default value likes (NEXT VALUE FOR PUBLIC SYSTEM_SEQUENCE_xxxxxxxx).

But when I try PostGRESQL (Business Data Model), the table is created with the persistenceid filed as a "bigint not null'. So, when the Bonita Server platform tries to insert a new record into Suppliers Table, the error show that put null value into the persistenceid field.

The image above, it's possible to see that:

Caused by: org.postgresql.util.PSQLException: ERROR: el valor null para la columna «persistenceid» viola la restricción not null Detail: La fila que falla contiene (null, aaa, JORDI CARRERAS, 0)

So, logically the problem is in the embedded Hibernate code into the Bonita Server Platform.

Its true ? Are there any solution to Bonita 7.3.2 version ?

Best regards.


No answers yet.