Commit 4bcab6f7 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@96548 ce508802-f39f-4f6c-b175-0d175dae99d5
parent b755fa7b
...@@ -44,9 +44,21 @@ public class DissIssuePosSave extends ValidatorEJB implements DissIssuePosSave ...@@ -44,9 +44,21 @@ public class DissIssuePosSave extends ValidatorEJB implements DissIssuePosSave
ResultSet rs = null; ResultSet rs = null;
double amount = 0,netAmount=0,discAmount=0,taxAmount=0,noArt = 0; //net_amt =amount+tax_amt-disc_amt 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; double grossWeight = 0 ,tareWeight = 0 , netWeight = 0;
boolean isLocalConn = false;
try try
{ {
//conn.setAutoCommit(false); // commented on 7-Oct-2014 as not needed for framework conn Sandesh
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
sql = "update distord_issdet set " sql = "update distord_issdet set "
...@@ -128,6 +140,12 @@ public class DissIssuePosSave extends ValidatorEJB implements DissIssuePosSave ...@@ -128,6 +140,12 @@ public class DissIssuePosSave extends ValidatorEJB implements DissIssuePosSave
} }
catch(Exception e) catch(Exception e)
{ {
// rollback code Sandesh 7-Oct-2014
try {
conn.rollback();
} catch (Exception d) {
d.printStackTrace();
}
e.printStackTrace(); e.printStackTrace();
throw new ITMException(e); throw new ITMException(e);
} }
...@@ -135,8 +153,16 @@ public class DissIssuePosSave extends ValidatorEJB implements DissIssuePosSave ...@@ -135,8 +153,16 @@ public class DissIssuePosSave extends ValidatorEJB implements DissIssuePosSave
{ {
try try
{ {
if(pstmt != null)pstmt.close(); if(isLocalConn){
pstmt = null; conn.commit();
conn.close();
conn = null;
}
if(pstmt != null){
pstmt.close();
pstmt = null;
}
}catch(Exception d) }catch(Exception d)
{ {
d.printStackTrace(); 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