5 Replies Latest reply on May 20, 2002 6:13 PM by kdavey67

    Connection problems with DatabaseServerLoginModule

    kdavey67

      I am usign the DatabaseServerLoginModule to validate the user. It works great, except for the first person to come in the morning will get an error. This is because the database is bounces every night and while the normal database ppols detect this and are not givign me a problem. I am having a problem with the DatabaseServerLoginModule not dropping its connection after a period of time. It appears that JBoss still thinks the connection is active. Is there anyway to time out this connection? What else can I do? Below is the bi from the auth.conf file for the login module.

      thanks

      kmd


      org.jboss.security.auth.spi.DatabaseServerLoginModule required
      dsJndiName="java:/OracleDS"
      principalsQuery="select user_password from gtype_user where system_username=?"
      rolesQuery="select r.role_name, 'Roles' from gtype_role r, user_role ur, gtype_user u where u.system_username=? and u.user_id = ur.user_id and ur.role_id = r.role_id"
      ;

        • 1. Re: Connection problems with DatabaseServerLoginModule
          jwkaltz

          I have a similar problem, even though I'm using ldap connections.

          I'm afraid the only answer I can give you is that you can write your own LoginModule (which look very much like the DatabaseServerLoginModule), where you would handle that error and try again automatically. This is definitely one possibility; perhaps there is way to configure the DatabaseServerLoginModule to handle this but I am not aware of it. In any case, I suggest as a starting point to look at the source code DatabaseServerLoginModule.java

          • 2. Re: Connection problems with DatabaseServerLoginModule
            kdavey67

            Thanks, that was what I was suspecting that I needed to do. Will try it.

            kmd

            • 3. Re: Connection problems with DatabaseServerLoginModule
              starksm64

              The DatabaseServerLoginModule does not hold onto a connection. It obtains a connection from the configured DataSource on each login and closes it immediately. If stale connections are showing up it is an issue with the DataSource connection pooling.

              • 4. Re: Connection problems with DatabaseServerLoginModule
                davidjencks

                Its always helpful to mention which jboss version you are using. In 3 >= rc2, you can just set idleTimeoutMinutes. It is possible to set an idletimeout in 2.4 versions, but you have to set several other parameters at the same time. Search the archives for instructions.

                • 5. Re: Connection problems with DatabaseServerLoginModule
                  kdavey67

                  I am using version 2.4.6 and in my connection pool to Oracle I have a connection idle timeout already set. The connections appear to timeout properly when they are used in the application. I did not think that this was a timeout issue. It appeared to me that the loginModule was holding on to the connection and not getting a new one when the first person tried to login in. The second attempt at logging in works just fine.

                  100
                  1800000
                  false


                  kmd