* Minor trx fix, reported here

- https://sourceforge.net/forum/message.php?msg_id=4349419
This commit is contained in:
Heng Sin Low 2007-06-07 02:07:30 +00:00
parent a904062c17
commit 366ff46f9d
1 changed files with 17 additions and 5 deletions

View File

@ -639,6 +639,18 @@ public class MSequence extends X_AD_Sequence
* @return Sequence
*/
public static MSequence get (Properties ctx, String tableName)
{
return get(ctx, tableName, null);
}
/**
* Get Sequence
* @param ctx context
* @param tableName table name
* @param trxName optional transaction name
* @return Sequence
*/
public static MSequence get (Properties ctx, String tableName, String trxName)
{
String sql = "SELECT * FROM AD_Sequence "
+ "WHERE UPPER(Name)=?"
@ -647,11 +659,11 @@ public class MSequence extends X_AD_Sequence
PreparedStatement pstmt = null;
try
{
pstmt = DB.prepareStatement (sql, null);
pstmt = DB.prepareStatement (sql, trxName);
pstmt.setString (1, tableName.toUpperCase());
ResultSet rs = pstmt.executeQuery ();
if (rs.next ())
retValue = new MSequence (ctx, rs, null);
retValue = new MSequence (ctx, rs, trxName);
if (rs.next())
s_log.log(Level.SEVERE, "More then one sequence for " + tableName);
rs.close ();