ozeigermann 2004/10/27 04:37:17
Modified: proposals/wck/src/org/apache/slide/simple/authentication
JAASLoginModule.java
Log:
Fixed bug making pool run out of connections fast.
Now assured connection is closed and put back into pool if applicable upon
login.
Revision Changes Path
1.3 +14 -4
jakarta-slide/proposals/wck/src/org/apache/slide/simple/authentication/JAASLoginModule.java
Index: JAASLoginModule.java
===================================================================
RCS file:
/home/cvs/jakarta-slide/proposals/wck/src/org/apache/slide/simple/authentication/JAASLoginModule.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- JAASLoginModule.java 13 Oct 2004 21:54:18 -0000 1.2
+++ JAASLoginModule.java 27 Oct 2004 11:37:17 -0000 1.3
@@ -151,13 +151,23 @@
m_sharedState.put("javax.security.auth.login.name", username);
m_sharedState.put("javax.security.auth.login.password", password);
+ Object conn = null;
try {
- Object conn = factory.getAuthenticationSession(username, new
String(password));
+ conn = factory.getAuthenticationSession(username, new
String(password));
if (conn == null) {
throw new LoginException("Could not authenticate");
}
} catch (Exception e) {
throw new LoginException("Could not create session: " +
e.getMessage());
+ } finally {
+ // need to close the connection we just authenticated with
+ if (conn != null) {
+ try {
+ factory.closeAuthenticationSession(conn);
+ } catch (Exception e1) {
+ Domain.error("Could not close connection", e1);
+ }
+ }
}
m_principal = new SlidePrincipal(username);
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]