Results 1 to 7 of 7
  1. #1
    Join Date
    May 2011
    Posts
    4

    Unanswered: Incorrect login via JSP actually attempting TWO Oracle logins?

    I really don't know if this is the appropriate place to post this question, but I've run into a very interesting problem.

    I administer a website that runs on Apache Tomcat 6.0, using JSP pages, and interfaces with an Oracle 10g database using the JDBC Thin client driver. We require our users to log in before they can gain access to the website, so we decided to let Oracle manage most of that. Each user has an Oracle account, and we have it set for their accounts to become locked after three failed logins.

    When I test this out using SQL Plus or SQL Worksheet, accounts do indeed become locked after three failed logins, which is great. However, when I create a connection in our JSP page, accounts become locked after only two failed logins. After some extensive testing by changing the # of failed logins allowed in Oracle, it seems as if the connection via JSP actually tries to log in TWICE. Here is my connection code:

    Code:
    DriverManager.registerDriver((Driver) Class.forName("oracle.jdbc.driver.OracleDriver").newInstance());
    conn = DriverManager.getConnection(dataBase, oracleID, tempPass);
    conn.close();
    That is wrapped inside of a try/catch block that catches the SQLExceptions, so I can figure out if the account is valid or not.

    I have worked around the issue by setting the # of failed logins to 5, but that does not follow the letter of our requirement, so I am wary to keep it this way.

    Does anyone know why the getConnection() function seems to attempt two logins instead of one? At least Oracle is tracking it that way. So bizarre!

    Thanks!

  2. #2
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    >Does anyone know why the getConnection() function seems to attempt two logins instead of one?
    not exactly an Oracle problem.
    You stated Oracle behaves correctly via sqlplus ( robust & reliable client).
    The best we can do I to give you our sympathy.
    Have A Nice Day (HAND!)
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  3. #3
    Join Date
    May 2011
    Posts
    4
    Quote Originally Posted by anacedent View Post
    >Does anyone know why the getConnection() function seems to attempt two logins instead of one?
    not exactly an Oracle problem.
    You stated Oracle behaves correctly via sqlplus ( robust & reliable client).
    The best we can do I to give you our sympathy.
    Have A Nice Day (HAND!)
    OK, cool, thanks. I guess I should post it in the JAVA forum? There's no JSP forum, so I was confused.

  4. #4
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    JDBC "bug"?
    Consider testing against V11.2 DB to see if behavior changes.
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  5. #5
    Join Date
    Nov 2003
    Posts
    2,932
    Provided Answers: 12
    Quote Originally Posted by Skywarpgold View Post
    After some extensive testing by changing the # of failed logins allowed in Oracle, it seems as if the connection via JSP actually tries to log in TWICE
    Sounds like your JSP page gets submitted twice.

  6. #6
    Join Date
    Aug 2003
    Location
    Where the Surf Meets the Turf @Del Mar, CA
    Posts
    7,776
    Provided Answers: 1
    wireshark or similar packet sniffer could be used to "see" number of login attempt between client & DB
    You can lead some folks to knowledge, but you can not make them think.
    The average person thinks he's above average!
    For most folks, they don't know, what they don't know.
    Good judgement comes from experience. Experience comes from bad judgement.

  7. #7
    Join Date
    May 2011
    Posts
    4
    Quote Originally Posted by shammat View Post
    Sounds like your JSP page gets submitted twice.
    Hmm, it's definitely not getting submitted twice. I made the page close itself right after the call, and it still incremented it twice after just one call...


    >wireshark or similar packet sniffer could be used to "see" number of login attempt between client & DB

    I'll see if I can give that a shot.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •