AnsweredAssumed Answered

Bad INSERT in Alfresco with PostgreSQL

Question asked by akuasleep on Jan 22, 2016
Latest reply on Jan 28, 2016 by akuasleep
When Alfresco finds a database error like that, it will keep retrying the transaction many times, until it succeeds. That occurs when a thread gets a new id for a piece of information, then tries to insert it in a table, and, if it fails, then it tries again with the next id sequence. I think that it may be possible that we are observing multiple threads getting the same id at the same time, and when trying to update the table, and failing, and keep attempting again.

I just reviewed very quickly one of the logs, and I saw many messages like the following:

2015-11-10 17:10:04 CET [unknown] alfrescousr 126.177.150.12 25925 ERROR: duplicate key value violates unique constraint "idx_alf_conturl_cr"

Our DB administrator noticed that some kind of INSERT make trouble. INSERT ends but is still IDLE IN TRANSACTIONS. And numbers of this INSERTS are growing :((

insert into alf_node_properties
                 |         (
                 |             node_id, qname_id, locale_id, list_index,
                 |             actual_type_n, persisted_type_n,
                 |             boolean_value, long_value, float_value, double_value, string_value, serializable_value
                 |         )
                 |         values
                 |         (
                 |             $1, $2, $3, $4,
                 |             $5, $6,
                 |             $7, $8, $9, $10, $11, $12
                 |         )

Please help.

Outcomes