Commit 1ae6bb38 authored by ssurve's avatar ssurve

conn code enhanced to differentiate on local and framework conn. Updated as...

conn code enhanced to differentiate on local and framework conn. Updated as conn was getting null on wizard Finish button


git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@27267 ce508802-f39f-4f6c-b175-0d175dae99d5
parent efe14f7d
......@@ -44,8 +44,20 @@ public class DissIssuePosSave extends ValidatorEJB implements DissIssuePosSave
ResultSet rs = null;
double amount = 0,netAmount=0,discAmount=0,taxAmount=0,noArt = 0; //net_amt =amount+tax_amt-disc_amt
double grossWeight = 0 ,tareWeight = 0 , netWeight = 0;
boolean isLocalConn = false;
try
{
if(conn == null){
ConnDriver connDriver = new ConnDriver();
conn = connDriver.getConnectDB("DriverITM");
connDriver= null;
isLocalConn = true;
conn.setAutoCommit(false);
}
//conn.setAutoCommit(false); // commented on 7-Oct-2014 as not needed for framework conn Sandesh
......@@ -128,6 +140,12 @@ public class DissIssuePosSave extends ValidatorEJB implements DissIssuePosSave
}
catch(Exception e)
{
// rollback code Sandesh 7-Oct-2014
try {
conn.rollback();
} catch (Exception d) {
d.printStackTrace();
}
e.printStackTrace();
throw new ITMException(e);
}
......@@ -135,8 +153,16 @@ public class DissIssuePosSave extends ValidatorEJB implements DissIssuePosSave
{
try
{
if(pstmt != null)pstmt.close();
if(isLocalConn){
conn.commit();
conn.close();
conn = null;
}
if(pstmt != null){
pstmt.close();
pstmt = null;
}
}catch(Exception d)
{
d.printStackTrace();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment