hg merge release-5.1 (merge release5.1 into default)

This commit is contained in:
Carlos Ruiz 2018-10-06 17:55:32 +02:00
commit 8c8db60532
1 changed files with 20 additions and 3 deletions

View File

@ -123,7 +123,11 @@ public class MSequence extends X_AD_Sequence
+ "FROM AD_Sequence " + "FROM AD_Sequence "
+ "WHERE Name=?" + "WHERE Name=?"
+ " AND IsActive='Y' AND IsTableID='Y' AND IsAutoSequence='Y' "; + " AND IsActive='Y' AND IsTableID='Y' AND IsAutoSequence='Y' ";
if(adempiereSys)
selectSQL += " FOR UPDATE OF CurrentNextSys";
else
selectSQL += " FOR UPDATE OF CurrentNext";
} }
if (!DB.isOracle() && !DB.isPostgreSQL()) if (!DB.isOracle() && !DB.isPostgreSQL())
selectSQL = DB.getDatabase().convertStatement(selectSQL); selectSQL = DB.getDatabase().convertStatement(selectSQL);
@ -365,14 +369,27 @@ public class MSequence extends X_AD_Sequence
+ "AND s.IsActive='Y' AND s.IsTableID='N' AND s.IsAutoSequence='Y' " + "AND s.IsActive='Y' AND s.IsTableID='N' AND s.IsAutoSequence='Y' "
+ "ORDER BY s.AD_Client_ID DESC"; + "ORDER BY s.AD_Client_ID DESC";
} }
if (DB.isPostgreSQL()) if (DB.isOracle() == false)
{ {
if ( ( isStartNewYear || isUseOrgLevel ) && !adempiereSys ) { if ( isStartNewYear || isUseOrgLevel ) {
selectSQL = selectSQL + " FOR UPDATE OF y"; selectSQL = selectSQL + " FOR UPDATE OF y";
} else { } else {
selectSQL = selectSQL + " FOR UPDATE OF s"; selectSQL = selectSQL + " FOR UPDATE OF s";
} }
} }
else
{
if (isStartNewYear || isUseOrgLevel) {
selectSQL = selectSQL + " FOR UPDATE OF y.";
} else {
selectSQL = selectSQL + " FOR UPDATE OF s.";
}
if(adempiereSys)
selectSQL = selectSQL + "CurrentNextSys";
else
selectSQL = selectSQL + "CurrentNext";
}
if (!DB.isOracle() && !DB.isPostgreSQL()) if (!DB.isOracle() && !DB.isPostgreSQL())
selectSQL = DB.getDatabase().convertStatement(selectSQL); selectSQL = DB.getDatabase().convertStatement(selectSQL);
Connection conn = null; Connection conn = null;