Ticket #5 (closed defect: fixed)

Opened 4 years ago

Last modified 2 years ago

Rollback doesn't work properly

Reported by: goiss Owned by:
Priority: major Milestone:
Component: MozartSpaces Version:
Keywords: Rollback Cc:

Description

Aus dem Tuwis Forum:

Also nachdem ich mich jetzt lange herumgeärgert habe, scheint es wohl an MozartSpaces zu liegen. Wenn man ein Destroy/Take mit anschließendem Transations-Rollback auf einem LindaCoordinator macht, wird per LindaSelector der Entry nicht mehr gefunden.

Folgendes Beispiel liefert den Output: entry written committed Ref container size (random): 1 Ref container size (linda): 1 entry destroyed rolled back Ref container size (random): 1 Ref container size (linda): 0

Sollte wohl nicht sein, oder?

public class TransactionTest {

private static void printContainerSize(

ContainerRef ref, ICapi capi) throws XCoreException {

System.out.printf(

"Ref container size (random): %d\n", capi.read(ref, 0, null, new RandomSelector(Selector.CNT_ALL)).length);

System.out.printf(

"Ref container size (linda): %d\n", capi.read(ref, 0, null, new LindaSelector(Selector.CNT_ALL, new AtomicEntry<String>("bla1"))).length);

}

public static void main(String[] args) {

ICapi capi = null; try {

capi = new Capi(); ContainerRef ref = capi.createContainer(

null, null, "ref1", IContainer.INFINITE_SIZE, new LindaCoordinator());

Transaction tx = null; try {

tx = capi.createTransaction(null, 0); Entry entry1 = new AtomicEntry<String>("bla1"); capi.write(ref, 0, tx, entry1); capi.commitTransaction(tx);

System.out.println("entry written committed"); printContainerSize(ref, capi);

tx = capi.createTransaction(null, 0); entry1 = new AtomicEntry<String>("bla1"); capi.destroy(ref, 0, tx, new LindaSelector(entry1)); capi.rollbackTransaction(tx);

System.out.println("entry destroyed rolled back"); printContainerSize(ref, capi);

} catch (XCoreException xe) {

xe.printStackTrace(); if (tx != null) {

capi.rollbackTransaction(tx);

}

}

} catch (XCoreException ex) {

ex.printStackTrace();

} finally {

if (capi != null) {

try {

capi.shutdown(null, true);

} catch (XCoreException ex) {

ex.printStackTrace();

}

}

}

}

}

Change History

comment:1 Changed 4 years ago by christian

  • Status changed from new to closed
  • Resolution set to fixed

fixed in rev 2557

comment:2 Changed 2 years ago by sim

 decoration Changed 1 year ago by admin

 bathtub Changed 1 year ago by admin

 solar system Changed 1 year ago by admin

 stair parts Changed 1 year ago by admin

 solar supply Changed 1 year ago by admin

Note: See TracTickets for help on using tickets.