Automatic rollback and re-execution

12 views
Skip to first unread message

eirikt

unread,
Apr 6, 2009, 9:26:39 AM4/6/09
to Deuce-STM
I am trying out Deuce here and now - it looks very cool :-)

I do have some questions though:
How do I know data integrity violations have been detected by Deuce?
Am I suppose to know? Or does Deuce rollback and re-execute whatever
necessary?
I had expected some sort of DataIntegrityException or something like
that...

What does '-Dorg.deuce.transaction.global' mean?
(It seems to be necessary for my test-code to execute successfully...)

Regards
Eirik Torske

Guy Korland

unread,
Apr 6, 2009, 4:33:50 PM4/6/09
to deuc...@googlegroups.com
Using the Deuce API (@Atomic) there shouldn't be any such.
Therefor you don't need to be aware of any.
Deuce has three different methods: Global, LSA & TL2.
Where all the all the methods keep the data integrity.

-Dorg.deuce.transaction.global means that you use a Global single lock, which is a reference implementation for the STM.
You shouldn't use it by default.

Can you please add the error you get when you don't use it?
Also can you please elaborate on the project you work on?

Thanks,
Guy
--
Guy Korland

eirikt

unread,
Apr 8, 2009, 5:26:09 AM4/8/09
to Deuce-STM
When I am not including '-Dorg.deuce.transaction.global=true' I always
get:
java.lang.NoSuchMethodError:
com.mycompany.training.stm.model.Account.getBalance(Lorg/deuce/
transaction/Context;)I
at
com.mycompany.training.stm.command.FragilePaymentTransfer.execute
(FragilePaymentTransfer.java:18)
at
com.mycompany.training.stm.command.DeuceSTMFragilePaymentTransfer.execute
(DeuceSTMFragilePaymentTransfer.java:19)
at
com.mycompany.training.stm.command.DeuceSTMFragilePaymentTransfer.execute
(DeuceSTMFragilePaymentTransfer.java)
at
com.mycompany.training.stm.command.PaymentTransferTask.doConcurrentTask
(PaymentTransferTask.java:17)
...

My Account class is a POJO of type:
public interface Account {
void deposit(int amount);
void withdraw(int amount);
String getAccountNumber();
int getBalance();
}
Account classes have no Deuse annotations present in neither interface
nor implementation class.

The transactional service is:
import org.deuce.Atomic;
import com.mycompany.training.stm.model.Account;
public class DeuceSTMFragilePaymentTransfer extends
FragilePaymentTransfer {
public DeuceSTMFragilePaymentTransfer(Account fromAccount, Account
toAccount, int amount) {
super(fromAccount, toAccount, amount);
}
@Override @Atomic public void execute() {
super.execute();
}
}

I am using org.deuce:deuceAgent:jar:1.0b5
I have tried most combinations of -Dorg.deuce.transaction.contextClass
and Deuce annotation settings, but the same thing happens.

Regards
Eirik T

Guy Korland

unread,
Apr 8, 2009, 8:52:51 AM4/8/09
to deuc...@googlegroups.com
Thanks,

I'll check it and get back to you.

Guy

On Wed, Apr 8, 2009 at 12:26 PM, eirikt <eirik....@gmail.com> wrote:
   int getBalance();



--
Guy Korland

Guy Korland

unread,
Apr 13, 2009, 7:16:48 PM4/13/09
to deuc...@googlegroups.com
Hi Eirik,

I'm sorry I didn't have time to check it yet and I probably be able to check it only in 7 days since I'm on my honeymoon :)
I promise I'll check at as soon as I'll get back.

Cheers,
Guy
--
Guy Korland
Reply all
Reply to author
Forward
0 new messages