掲示板

Getting org.hibernate.exception.ConstraintViolationException

6年前 に Alex Man によって更新されました。

Getting org.hibernate.exception.ConstraintViolationException

Junior Member 投稿: 70 参加年月日: 16/02/08 最新の投稿
I am using a serviceBuilder project in which I will use the build generated update method for updating or creating a row in the entity. The application is using by many people. Sometimes I am getting the following exception, is it because of the counter mispatch?

{"exception":"com.liferay.portal.kernel.dao.orm.ORMException","message":"org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update"}


Can anyone please help me on this
thumbnail
6年前 に David H Nebinger によって更新されました。

RE: Getting org.hibernate.exception.ConstraintViolationException

Liferay Legend 投稿: 14916 参加年月日: 06/09/02 最新の投稿
Hard to say, this error doesn't give any details such as what entity is broken or any stack trace information.

You mention the counter, I guess because you might have some insight that suggests there may be contention there. If you're using the CounterLocalService instance available inside of your service layer to assign counter values, you shouldn't have any collisions there to worry about.






Come meet me at the 2017 LSNA!
6年前 に Alex Man によって更新されました。

RE: Getting org.hibernate.exception.ConstraintViolationException

Junior Member 投稿: 70 参加年月日: 16/02/08 最新の投稿
David H Nebinger:
Hard to say, this error doesn't give any details such as what entity is broken or any stack trace information.

You mention the counter, I guess because you might have some insight that suggests there may be contention there. If you're using the CounterLocalService instance available inside of your service layer to assign counter values, you shouldn't have any collisions there to worry about


Can we have any issues such as:
1. Lets say if it accessible to 100's of users, if they parallely triggers some update action for an entity, does that counter works correctly.
2. If I restart the liferay server, but service builder does not trigger the table updation since the build version is lower in db
thumbnail
6年前 に David H Nebinger によって更新されました。

RE: Getting org.hibernate.exception.ConstraintViolationException (回答)

Liferay Legend 投稿: 14916 参加年月日: 06/09/02 最新の投稿
The counter class has been well tested over like 10 years now under more load than you're going to send at it.

I don't understand #2. If it was deployed and working before the shutdown, it will remain working after restart.









Come meet me at the 2017 LSNA!