LanguageConnectionContext lcc = (LanguageConnectionContext)
ContextService.getContext(LanguageConnectionContext.CONTEXT_ID);
TableNameInfo tabInfo = null;
TransactionInfo[] tt = null;
TransactionController tc = null;
if (lcc != null) {
try {
tc = lcc.getTransactionExecute();
tabInfo = new TableNameInfo(lcc, false);
tt = tc.getAccessManager().getTransactionInfo();
} catch (StandardException se) {
// just don't get any table info.
}
}
StringBuffer sb = new StringBuffer(200);
Hashtable attributes = new Hashtable(17);
String victimXID = null;
for (int i = 0; i < chain.size(); i++) {
Object space = chain.elementAt(i);
if (space instanceof List) {
List grants = (List) space;
if (grants.size() != 0) {
sb.append(" Granted XID : ");
for (int j = 0; j < grants.size(); j ++) {
if (j != 0)
sb.append(", ");
Lock gl = (Lock) grants.get(j);
sb.append("{");
sb.append(gl.getCompatabilitySpace().getOwner());
sb.append(", ");
sb.append(gl.getQualifier());
sb.append("} ");
}
sb.append('\n');
}
continue;
}
// Information about the lock we are waiting on
// TYPE |TABLENAME |LOCKNAME
Lock lock = ((Lock) waiters.get(space));
// see if this lockable object wants to participate
lock.getLockable().lockAttributes(VirtualLockTable.ALL, attributes);
addInfo(sb, "Lock : ", attributes.get(VirtualLockTable.LOCKTYPE));
if (tabInfo != null) {
Long conglomId = (Long) attributes.get(VirtualLockTable.CONGLOMID);
if (conglomId == null) {
Long containerId = (Long) attributes.get(VirtualLockTable.CONTAINERID);
try {
conglomId = new Long(tc.findConglomid(containerId.longValue()));
} catch (StandardException se) {
}
}
addInfo(sb, ", ", tabInfo.getTableName(conglomId));
}