mirror of https://github.com/apache/openjpa.git
OPENJPA-1840: handle query timeouts with Sybase - SQLState JZ006:JZ0TO
git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@1023838 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
3707cc8b6d
commit
f9cfbbfe2c
|
@ -40,6 +40,7 @@ import org.apache.openjpa.lib.jdbc.DelegatingConnection;
|
|||
import org.apache.openjpa.lib.util.ConcreteClassGenerator;
|
||||
import org.apache.openjpa.lib.util.Localizer;
|
||||
import org.apache.openjpa.meta.JavaTypes;
|
||||
import org.apache.openjpa.util.StoreException;
|
||||
|
||||
/**
|
||||
* Dictionary for Sybase.
|
||||
|
@ -407,6 +408,16 @@ public class SybaseDictionary
|
|||
idx.setUnique(!getBooleanFromResultSet(idxMeta, "NON_UNIQUE", "non_unique"));
|
||||
return idx;
|
||||
}
|
||||
|
||||
public boolean isFatalException(int subtype, SQLException ex) {
|
||||
if (subtype == StoreException.LOCK) {
|
||||
SQLException next = ex.getNextException();
|
||||
if("JZ0TO".equals(next.getSQLState())) {
|
||||
return false; // query timeout
|
||||
}
|
||||
}
|
||||
return super.isFatalException(subtype, ex);
|
||||
}
|
||||
|
||||
/**
|
||||
* Connection wrapper to cache the {@link Connection#getCatalog} result,
|
||||
|
|
|
@ -56,7 +56,7 @@
|
|||
</dictionary>
|
||||
|
||||
<dictionary class="org.apache.openjpa.jdbc.sql.SybaseDictionary">
|
||||
<lock>1204,1205,1279</lock>
|
||||
<lock>1204,1205,1279, JZ006</lock>
|
||||
<referential-integrity>423,511,515,530,547,2601,2615,2714</referential-integrity>
|
||||
<object-exists>23000</object-exists>
|
||||
<object-not-found></object-not-found>
|
||||
|
|
Loading…
Reference in New Issue