public void add(int index, Object element)
{
DListEntry entry = prepareEntry(element);
elements.add(index, entry);
// if we are in a transaction: acquire locks !
TransactionImpl tx = getTransaction();
if (checkForOpenTransaction(tx))
{
RuntimeObject rt = new RuntimeObject(this, tx);
List regList = tx.getRegistrationList();
tx.lockAndRegister(rt, Transaction.WRITE, false, regList);
rt = new RuntimeObject(element, tx);
tx.lockAndRegister(rt, Transaction.READ, regList);
rt = new RuntimeObject(entry, tx, true);
tx.lockAndRegister(rt, Transaction.WRITE, false, regList);
}
// changing the position markers of entries:
int offset = 0;
try