1.this is how my dao class look like where the transaction code keep repeat for every method. possible to put these snippet code in super class so that i do no need to repeat below code all the time? any elaborate how to do this?
2.if there is a need to put the snippet in super.class. should the super.class be static?
for (int i = 0; i < NUM_RETRIES; i++) {
pm.currentTransaction().begin();
<all my code will be here>
try {
pm.currentTransaction().commit();
break;
} catch (JDOCanRetryException ex) {
if (i == (NUM_RETRIES - 1)) {
throw ex;
}
}
}