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

@ -124,6 +124,10 @@ public class MSequence extends X_AD_Sequence
+ "WHERE Name=?"
+ " 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())
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' "
+ "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";
} else {
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())
selectSQL = DB.getDatabase().convertStatement(selectSQL);
Connection conn = null;