Skip to content
Advertisement

Deadlock when we we have dependent entities in hibernate and try to update table using multiple threads in Vertica

I have two java classes. Father.java and Children.java

I receive the Deadlock X exception if several threads visit the same table (entity father) to updates with distinct row entries, even though the records are different.

Is there any way to fix why the entire table locks up instead than just one row? Even though I haven’t updated or added anything to the code, the transaction isolation level is SERIALIZABLE.

DB system is Vertica

Advertisement

Answer

Explained here, if anyone is coming here to check why Vertica doesn’t support row level locks for updates or delete. https://stackoverflow.com/a/69917383/8799862

So I used synchronized to perform thread-safe updates and deletes.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement