Skip to content

Commit

Permalink
Issue 50488: Pre-register this data source's SQL error codes in Sprin…
Browse files Browse the repository at this point in the history
…g to prevent deadlocks (#5528)
  • Loading branch information
labkey-nicka authored May 24, 2024
1 parent d1fbb63 commit e7b4659
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions api/src/org/labkey/api/data/DbScope.java
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
import org.labkey.api.util.logging.LogHelper;
import org.labkey.data.xml.TablesDocument;
import org.springframework.dao.DeadlockLoserDataAccessException;
import org.springframework.jdbc.support.SQLErrorCodesFactory;

import javax.naming.Binding;
import javax.naming.Context;
Expand Down Expand Up @@ -549,6 +550,9 @@ private static LabKeyDataSource setPrimaryDataSource(Map<String, LabKeyDataSourc
_provisionedTableCache = new SchemaTableInfoCache(this, true);
_rds = _dialect.isRds(this);
_escape = dbmd.getSearchStringEscape();

// Issue 50488: Pre-register this data source's SQL error codes in Spring to prevent deadlocks
SQLErrorCodesFactory.getInstance().registerDatabase(dataSource.getDataSource(), _databaseProductName);
}
}

Expand Down

0 comments on commit e7b4659

Please sign in to comment.