[ 1895357 ] SignDatabaseBuild - Transaction read-only Error
- new fix, set concurrency base on sql.
This commit is contained in:
parent
17ad1bcfc2
commit
a8ebaee19f
|
@ -680,25 +680,33 @@ public final class DB
|
||||||
|
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
* Prepare Read Only Statement
|
* Prepare Statement
|
||||||
* @param RO_SQL sql (RO)
|
* @param sql
|
||||||
* @return Prepared Statement
|
* @return Prepared Statement
|
||||||
* @deprecated
|
* @deprecated
|
||||||
*/
|
*/
|
||||||
public static CPreparedStatement prepareStatement (String RO_SQL)
|
public static CPreparedStatement prepareStatement (String sql)
|
||||||
{
|
{
|
||||||
return prepareStatement(RO_SQL, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY, null);
|
int concurrency = ResultSet.CONCUR_READ_ONLY;
|
||||||
|
String upper = sql.toUpperCase();
|
||||||
|
if (upper.startsWith("UPDATE ") || upper.startsWith("DELETE "))
|
||||||
|
concurrency = ResultSet.CONCUR_UPDATABLE;
|
||||||
|
return prepareStatement(sql, ResultSet.TYPE_FORWARD_ONLY, concurrency, null);
|
||||||
} // prepareStatement
|
} // prepareStatement
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Prepare Read Only Statement
|
* Prepare Statement
|
||||||
* @param RO_SQL sql (RO)
|
* @param sql
|
||||||
* @param trxName transaction
|
* @param trxName transaction
|
||||||
* @return Prepared Statement
|
* @return Prepared Statement
|
||||||
*/
|
*/
|
||||||
public static CPreparedStatement prepareStatement (String RO_SQL, String trxName)
|
public static CPreparedStatement prepareStatement (String sql, String trxName)
|
||||||
{
|
{
|
||||||
return prepareStatement(RO_SQL, ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_READ_ONLY, trxName);
|
int concurrency = ResultSet.CONCUR_READ_ONLY;
|
||||||
|
String upper = sql.toUpperCase();
|
||||||
|
if (upper.startsWith("UPDATE ") || upper.startsWith("DELETE "))
|
||||||
|
concurrency = ResultSet.CONCUR_UPDATABLE;
|
||||||
|
return prepareStatement(sql, ResultSet.TYPE_FORWARD_ONLY, concurrency, trxName);
|
||||||
} // prepareStatement
|
} // prepareStatement
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue