Thank you.

From: Tom Pantelis [mailto:[email protected]]
Sent: Thursday, September 15, 2016 4:06 PM
To: Sela, Guy <[email protected]>
Cc: [email protected]; [email protected]
Subject: Re: [controller-dev] TransactionChain

I assume you mean:

Future f = t1.submit();
Futures.addCallback(f, new Callback{
AsyncReadTransaction t2 = broker.newReadOnlyTransaction();
Optional<?> maybeData = t2.read(id).get();
}

yes that would accomplish the result that the TransactionChain provides. But 
with TransactionChain, you don't have to wait for the write to be committed - 
you can read it immediately after submitting. Also makes the code simpler.

On Thu, Sep 15, 2016 at 6:27 AM, Sela, Guy 
<[email protected]<mailto:[email protected]>> wrote:
Does this entity exist only to solve the problem in the javadoc?

“
AsyncWriteTransaction t1 = broker.newWriteOnlyTransaction();
t1.put(id, data);
t1.submit();

AsyncReadTransaction t2 = broker.newReadOnlyTransaction();
Optional<?> maybeData = t2.read(id).get();
“


Can’t it be solved with this code? (Pseudo code)

AsyncWriteTransaction t1 = broker.newWriteOnlyTransaction();
t1.put(id, data);
Future f = t1.submit();
Futures.addCallback(new Callback{
AsyncReadTransaction t2 = broker.newReadOnlyTransaction();
Optional<?> maybeData = t2.read(id).get();
}





Thanks,
Guy Sela


_______________________________________________
controller-dev mailing list
[email protected]<mailto:[email protected]>
https://lists.opendaylight.org/mailman/listinfo/controller-dev

_______________________________________________
controller-dev mailing list
[email protected]
https://lists.opendaylight.org/mailman/listinfo/controller-dev

Reply via email to