Skip to content
gkorland edited this page Mar 31, 2013 · 1 revision

All you have to do is to annotate your transactional methods with @atomic, i.e.:

@Atomic
public void myTransaction(){
...
}

Then all you need to in order to run it, is to add to your java command line: -javaagent:bin/deuceAgent.jar e.g. java -javaagent:bin/deuceAgent.jar -cp my.jar myMain Using this javaagent Deuce is doing an Online Instrumentation, meaning instrumenting the application bytecode in runtime.

Flow control Deuce support two mechanism to control the Transaction flow: org.deuce.transaction.TransactionException - When thrown the current active transaction context will be rolled back and a new transaction retry will start. org.deuce.transaction.AbortTranactionException - When thrown the current active transaction context will be rolled back and the AbortTranactionException will be rethrown. Offline instrumentation

In few case Online instrumentation is not good enough due to some limitation (e.g. classes that are loaded in the boot classloader). Therefor, Deuce provides an offline mode e.g.

java -jar deuceAgent.jar my.jar out_my.jar

This will instrument my.jar and create a new instrumented out_my.jar.

Clone this wiki locally