Transaction tx = null;
Transaction tx2 = null;
OTMConnection conn2;
ProductGroup pg = null;
ProductGroup pg2 = null;
Identity pOid = null;
Identity pOid2 = null;
conn2 = _kit.acquireConnection(PersistenceBrokerFactory.getDefaultKey());
try
{
tx = _kit.getTransaction(_conn);
tx.begin();
pg = new ProductGroup();
pg.setId(77777);
pg.setName("1");
pOid = _conn.getIdentity(pg);
if (_conn.getObjectByIdentity(pOid) == null)
{
_conn.makePersistent(pg);
}
pg2 = new ProductGroup();
pg2.setId(77778);
pg2.setName("1");
pOid2 = _conn.getIdentity(pg2);
if (_conn.getObjectByIdentity(pOid2) == null)
{
_conn.makePersistent(pg2);
}
tx.commit();
final Identity pgOid = _conn.getIdentity(pg);
final Identity pgOid2 = _conn.getIdentity(pg2);
final Transaction tx3 = _kit.getTransaction(_conn);
tx3.begin();
_conn.getObjectByIdentity(pgOid, LockType.WRITE_LOCK);