[Idrs-commit] CVS: Idrs/dev/src/net/sourceforge/idrs/core/servlet IDRSServlet.java,1.14,1.15
Brought to you by:
bigman921
|
From: Marc B. <big...@us...> - 2002-09-16 16:22:32
|
Update of /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/core/servlet
In directory usw-pr-cvs1:/tmp/cvs-serv3376/dev/src/net/sourceforge/idrs/core/servlet
Modified Files:
IDRSServlet.java
Log Message:
Fixed a bug with returning the authentication connection
Index: IDRSServlet.java
===================================================================
RCS file: /cvsroot/idrs/Idrs/dev/src/net/sourceforge/idrs/core/servlet/IDRSServlet.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** IDRSServlet.java 16 Sep 2002 15:19:42 -0000 1.14
--- IDRSServlet.java 16 Sep 2002 16:22:29 -0000 1.15
***************
*** 146,150 ****
init.returnScriptContext(poolInfo.idrss);
if (poolInfo.conns != null)
! returnConns(poolInfo.conns);
}
req.setAttribute("fetchAddr", null);
--- 146,153 ----
init.returnScriptContext(poolInfo.idrss);
if (poolInfo.conns != null)
! returnConns(poolInfo.conns,poolInfo);
! if (poolInfo.authDB != null)
! init.getDBPool(init.getAuthDbName()).returnConnection(poolInfo.authDB);
!
}
req.setAttribute("fetchAddr", null);
***************
*** 202,206 ****
}
! private boolean getConns(Object[] conNames,HashMap conns,Connection authCon) throws Exception {
String conString;
DbPool pool;
--- 205,209 ----
}
! private boolean getConns(Object[] conNames,HashMap conns,Connection authCon,PoolInfo poolInfo) throws Exception {
String conString;
DbPool pool;
***************
*** 216,220 ****
//fatal error has occurred
! returnConns(conns);
throw noMore;
--- 219,223 ----
//fatal error has occurred
! returnConns(conns,poolInfo);
throw noMore;
***************
*** 224,228 ****
if (con == null) {
! returnConns(conns);
return false;
}
--- 227,231 ----
if (con == null) {
! returnConns(conns,poolInfo);
return false;
}
***************
*** 241,253 ****
}
! private void returnConns(HashMap conns) throws Exception {
Iterator it = conns.keySet().iterator();
String key;
Connection con;
DbPool pool;
!
while (it.hasNext()) {
key = (String) it.next();
con = (Connection) conns.get(key);
//if (! key.equals(init.getAuthDbName())) {
pool = init.getDBPool(key);
--- 244,263 ----
}
! private void returnConns(HashMap conns,PoolInfo poolInfo ) throws Exception {
Iterator it = conns.keySet().iterator();
String key;
Connection con;
DbPool pool;
!
!
while (it.hasNext()) {
key = (String) it.next();
+
+
+
con = (Connection) conns.get(key);
+ if (con == poolInfo.authDB)
+ poolInfo.authDB = null;
+
//if (! key.equals(init.getAuthDbName())) {
pool = init.getDBPool(key);
***************
*** 255,258 ****
--- 265,270 ----
//}
}
+
+
}
***************
*** 444,449 ****
--- 456,464 ----
//retrieve the system connection
+ System.out.println("Retrieving AuthDB");
Connection authDB = init.getDBPool(init.getAuthDbName()).getConnection();
if (authDB == null) throw new Exception("Unable to retrieve authentication connection");
+ poolInfo.authDB = authDB;
+ System.out.println("Retrieved AuthDB");
//initialize a security object for retrieving all report information
***************
*** 489,501 ****
poolInfo.conns = new HashMap();
IDRSScriptLanguage idrss = init.getScriptContext();
poolInfo.idrss = idrss;
! if (! getConns(secure.getConns(), poolInfo.conns,authDB )) {
throw new Exception("The Server is Busy, Please Try Again Later");
}
//retrieve report
IDRSRep rep = getReport(docID,docName);
//initialize some information about the report
poolInfo.docName = docName;
--- 504,522 ----
poolInfo.conns = new HashMap();
+ System.out.println("Retrieving ScriptContext");
IDRSScriptLanguage idrss = init.getScriptContext();
+ System.out.println("Retrieved ScriptContext");
poolInfo.idrss = idrss;
! System.out.println("Retrieving Conns");
! if (! getConns(secure.getConns(), poolInfo.conns,authDB,poolInfo )) {
throw new Exception("The Server is Busy, Please Try Again Later");
}
+ System.out.println("Retrieved Conns");
//retrieve report
+ System.out.println("Retrieving Rep");
IDRSRep rep = getReport(docID,docName);
+ System.out.println("Retrieved Rep");
//initialize some information about the report
poolInfo.docName = docName;
***************
*** 506,509 ****
--- 527,531 ----
//lets run the page
//re-init the page
+ System.out.println("Init");
rep.getHead().init(poolInfo.conns, secure.getUserID(), secure.getDocID(), "",req.getSession(), req, resp, init.getApplication(), poolInfo.idrss, new UserInfo(secure.getGroups(), secure.getUserID(), secure.getUserName()), init.digestPassword() ? init.getDigestType() : "NONE");
***************
*** 512,515 ****
--- 534,538 ----
//build the report
+ System.out.println("building");
buffer = rep.buildReport();
***************
*** 614,617 ****
--- 637,641 ----
HashMap conns;
String docName;
+ Connection authDB;
}
|