FR [1921784]

This commit is contained in:
Heng Sin Low 2008-03-21 01:06:18 +00:00
parent 4b777f3ba4
commit 1646564349
1 changed files with 23 additions and 0 deletions

View File

@ -19,6 +19,7 @@ package org.compiere.util;
import java.beans.*; import java.beans.*;
import java.rmi.RemoteException; import java.rmi.RemoteException;
import java.sql.*; import java.sql.*;
import java.util.Collection;
import java.util.UUID; import java.util.UUID;
import java.util.logging.*; import java.util.logging.*;
@ -129,6 +130,8 @@ public class Trx implements VetoableChangeListener
private String m_trxName = null; private String m_trxName = null;
private boolean m_active = false; private boolean m_active = false;
private long m_startTime;
/** /**
* Get Connection * Get Connection
* @return connection * @return connection
@ -202,9 +205,18 @@ public class Trx implements VetoableChangeListener
startRemoteTransaction(); startRemoteTransaction();
} }
m_active = true; m_active = true;
m_startTime = System.currentTimeMillis();
return true; return true;
} // startTrx } // startTrx
/**
* @return The start time of this transaction
*/
public Date getStartTime()
{
return new Date(m_startTime);
}
private void startRemoteTransaction() { private void startRemoteTransaction() {
Server server = CConnection.get().getServer(); Server server = CConnection.get().getServer();
try try
@ -647,5 +659,16 @@ public class Trx implements VetoableChangeListener
log.info(evt.toString()); log.info(evt.toString());
} // vetoableChange } // vetoableChange
/**
* @return Trx[]
*/
public static Trx[] getActiveTransactions()
{
Collection<Trx> collections = s_cache.values();
Trx[] trxs = new Trx[collections.size()];
collections.toArray(trxs);
return trxs;
}
} // Trx } // Trx