[ 
https://jira.nuxeo.com/browse/NXP-7356?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=100195#comment-100195
 ] 

Stéphane Lacoin commented on NXP-7356:
--------------------------------------

After multiple investigations, we found that

* the isolation level played was not {{SNAPSHOT}} has expected (see 
[NXDOC:Configuring MS SQL Server])

By setting the isolation level on the connection, we were still getting errors 
from the database. Errors were mainly to delete statements.

{code}
Caused by: org.nuxeo.ecm.core.api.WrappedException: Exception: 
org.nuxeo.ecm.core.api.DocumentException. message: 
org.nuxeo.ecm.core.storage.StorageException: Could not delete: hierarchy
        at 
org.nuxeo.ecm.core.storage.sql.coremodel.SQLSession.save(SQLSession.java:145)
        at 
org.nuxeo.ecm.core.api.AbstractSession.save(AbstractSession.java:1823)
        ... 55 more
Caused by: org.nuxeo.ecm.core.api.WrappedException: Exception: 
org.nuxeo.ecm.core.storage.StorageException. message: Could not delete: 
hierarchy
        at 
org.nuxeo.ecm.core.storage.sql.jdbc.JDBCRowMapper.deleteRowsDirect(JDBCRowMapper.java:711)
        at 
org.nuxeo.ecm.core.storage.sql.jdbc.JDBCRowMapper.deleteRows(JDBCRowMapper.java:687)
        at 
org.nuxeo.ecm.core.storage.sql.jdbc.JDBCRowMapper.writeDeletes(JDBCRowMapper.java:502)
        at 
org.nuxeo.ecm.core.storage.sql.jdbc.JDBCRowMapper.write(JDBCRowMapper.java:436)
        at 
org.nuxeo.ecm.core.storage.sql.CachingRowMapper.write(CachingRowMapper.java:350)
        at 
org.nuxeo.ecm.core.storage.sql.SessionImpl.flush(SessionImpl.java:285)
        at org.nuxeo.ecm.core.storage.sql.SessionImpl.save(SessionImpl.java:266)
        at 
org.nuxeo.ecm.core.storage.sql.ra.ConnectionImpl.save(ConnectionImpl.java:174)
        at 
org.nuxeo.ecm.core.storage.sql.coremodel.SQLSession.save(SQLSession.java:143)
        ... 56 more
Caused by: org.nuxeo.ecm.core.api.WrappedException: Exception: 
java.sql.SQLException. message: Snapshot isolation transaction aborted due to 
update conflict. You cannot use snapshot isolation to access table 
'dbo.hierarchy' directly or indirectly in data\
base 'nuxeo' to update, delete, or insert the row that has been modified or 
deleted by another transaction. Retry the transaction or change the isolation 
level for the update/delete statement.

{code}

We've suspected the delete cascade played by the trigger is entering in 
conflict with the delete statements of non hierarchy fragments. By disabling 
the generation of these statements, we solved the problem.

> transaction deadlocks while updating documents wlth a SQL server backend
> ------------------------------------------------------------------------
>
>                 Key: NXP-7356
>                 URL: https://jira.nuxeo.com/browse/NXP-7356
>             Project: Nuxeo Enterprise Platform
>          Issue Type: Bug
>          Components: Core SQL Storage
>    Affects Versions: 5.4.1
>            Reporter: Stéphane Lacoin
>            Priority: Critical
>             Fix For: 5.4.3
>
>
> In scenari, when we're importing documents in parallel, we've got errors from 
> the database :
> {code}
> Caused by: org.nuxeo.ecm.core.api.WrappedException: Exception: 
> java.sql.BatchUpdateException. message: Transaction (Process ID 65) was 
> deadlocked on lock resources with another proc\
> ess and has been chosen as the deadlock victim. Rerun the transaction.
> {code}
> Each import is rooted in a distinct folder. So the database alters should not 
> conflicts. 

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

       
_______________________________________________
ECM-tickets mailing list
[email protected]
http://lists.nuxeo.com/mailman/listinfo/ecm-tickets

Reply via email to