Bug 4567

Summary: Open and Close are executed in their own transaction?
Product: jbatch Reporter: mminella
Component: sourceAssignee: cvignola
Status: RESOLVED WORKSFORME    
Severity: normal CC: issues
Priority: P5    
Version: 1   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description mminella 2013-01-18 17:09:29 UTC
In many of the flows described in section 8 wrap the open and close methods with their own transaction.  Why are these methods executed within their own transaction?
Comment 1 cvignola 2013-01-18 17:27:18 UTC
So they don't contribute time to the first and last chunk's transaction time.
Comment 2 mminella 2013-01-18 20:16:57 UTC
I'm not implying that they be included in the chunk's transaction...I'm wondering why they get their own transaction at all?  Since open and close are intended to be used for resource management (and not for business processing which would be assumed to be the transactional work), why do they need to be wrapped in their own transaction?
Comment 3 cvignola 2013-01-21 14:26:34 UTC
It is necessary so open can do rational things in open like create a db connection.  You cannot create a connection in local mode and then enlist in global trans.  So you need a consistent transaction mode else you impose unreasonable restrictions on the use of open.  You might be able to get away with always running close in local mode, but it's probably better for open and close to be consistent.