Hi Pinaki,

my thoughts go in the same direction.
Here the code of the task manager bean:
....
    @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
    public void finishTask(String name) {
        Task task = findOrCreateTask(name);
        task.setFailureCount(0);
        task.setRunningSince(null);
        task.setState(TaskState.IDLE);
//        entityManager.flush();
        logger.log(Log.DEBUG, "Task " + name + " finished.");
    }

    private Task findOrCreateTask(String name) {
        Task task = entityManager.find(Task.class, name);
        if (null == task) {
            task = new Task(name);
            entityManager.persist(task);
        }
        return task;
    }
...

I don't no actively close the db2 connection, the surrounding transaction in
myMethod(...) should be rolled back, by the container but after the method
left by exception and not before its internal catch block. Btw. 'myMethod()'
is tagged as Transaction.Requires (in ejb-jar.xml)

-----
Kind regards
Matthias
-- 
View this message in context: 
http://openjpa.208410.n2.nabble.com/cursor-prepared-statement-problem-with-WebLogic-10-3-2-tp5724027p5744447.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

Reply via email to