logging changes

This commit is contained in:
Alex Huang 2011-06-27 10:19:53 -07:00
parent 5810b838ed
commit 791dd9777b
3 changed files with 8 additions and 9 deletions

View File

@ -2303,7 +2303,6 @@ public class UserVmManagerImpl implements UserVmManager, UserVmService, Manager
return createVirtualMachine(zone, serviceOffering, template, hostName, displayName, owner, diskOfferingId, diskSize, networkList, null, group, userData, sshKeyPair, hypervisor, caller, requestedIps, defaultIp);
}
@DB
@ActionEvent(eventType = EventTypes.EVENT_VM_CREATE, eventDescription = "deploying Vm", create = true)
protected UserVm createVirtualMachine(DataCenter zone, ServiceOffering serviceOffering, VirtualMachineTemplate template, String hostName, String displayName, Account owner, Long diskOfferingId,
Long diskSize, List<NetworkVO> networkList, List<Long> securityGroupIdList, String group, String userData, String sshKeyPair, HypervisorType hypervisor, Account caller, Map<Long, String> requestedIps, String defaultNetworkIp) throws InsufficientCapacityException, ResourceUnavailableException, ConcurrentOperationException, StorageUnavailableException, ResourceAllocationException {

View File

@ -875,7 +875,7 @@ public abstract class GenericDaoBase<T, ID extends Serializable> implements Gene
return lockRow(id, null);
}
@Override
@Override @DB(txn=false)
public T lockRow(ID id, Boolean lock) {
return findById(id, false, lock);
}

View File

@ -94,7 +94,7 @@ public class Transaction {
Transaction txn = tls.get();
assert txn != null : "No Transaction on stack. Did you mark the method with @DB?";
assert checkAnnotation(3, txn) : "Did you even read the guide to use Transaction...IOW...other people's code? Try method can't be private. What about @DB? hmmm... could that be it? " + txn.toString();
assert checkAnnotation(3, txn) : "Did you even read the guide to use Transaction...IOW...other people's code? Try method can't be private. What about @DB? hmmm... could that be it? " + txn;
return txn;
}
@ -354,7 +354,7 @@ public class Transaction {
if (_stmt != null) {
try {
if (s_stmtLogger.isTraceEnabled()) {
s_stmtLogger.trace("Closing: " + _stmt.toString());
s_stmtLogger.trace("Closing: " + _stmt);
}
try {
ResultSet rs = _stmt.getResultSet();
@ -366,7 +366,7 @@ public class Transaction {
}
_stmt.close();
} catch (final SQLException e) {
s_stmtLogger.trace("Unable to close statement: " + _stmt.toString());
s_stmtLogger.trace("Unable to close statement: " + _stmt);
} finally {
_stmt = null;
}
@ -721,7 +721,7 @@ public class Transaction {
} else if (item.type == STATEMENT) {
try {
if (s_stmtLogger.isTraceEnabled()) {
s_stmtLogger.trace("Closing: " + ref.toString());
s_stmtLogger.trace("Closing: " + ref);
}
Statement stmt = (Statement)ref;
try {
@ -734,7 +734,7 @@ public class Transaction {
}
stmt.close();
} catch (final SQLException e) {
s_stmtLogger.trace("Unable to close statement: " + item.toString());
s_stmtLogger.trace("Unable to close statement: " + item);
}
} else if (item.type == ATTACHMENT) {
TransactionAttachment att = (TransactionAttachment)item.ref;
@ -783,7 +783,7 @@ public class Transaction {
_conn.rollback(sp);
}
} catch (SQLException e) {
s_logger.warn("Unable to rollback to savepoint " + sp.toString());
s_logger.warn("Unable to rollback to savepoint " + sp);
}
if (!hasTxnInStack()) {
@ -899,7 +899,7 @@ public class Transaction {
@Override
public String toString() {
return type + "-" + (ref != null ? ref.toString() : "");
return type + "-" + ref;
}
}