Analysis of a session-time problem with the JDBC store in Weblogic92

Source: Internet
Author: User
Tags sessions

In Weblogic92, many systems to reduce the memory overhead of the system, or to prevent session loss, managers will be using the JDBC store to store sessions information. However, in the use of this configuration, many customers will encounter constraints conflict of the exception information, such as,

<jan, 2009 10:07:33 AM cst> <Error>

Java.sql.sqlexception:ora-00001:unique constraint (SYSTEM. SYS_C003007) violated

At Oracle.jdbc.driver.DatabaseError.throwSqlException (databaseerror.java:112)

At Oracle.jdbc.driver.T4CTTIoer.processError (t4cttioer.java:331)

At Oracle.jdbc.driver.T4CTTIoer.processError (t4cttioer.java:288)

At Oracle.jdbc.driver.T4C8Oall.receive (t4c8oall.java:743)

At Oracle.jdbc.driver.T4CPreparedStatement.doOall8 (t4cpreparedstatement.java:216)

truncated. The log file for complete StackTrace

This article on this issue for analysis, to see what kind of reasons will cause the above problems.

First, let's think about why there are errors such as ORA-00001. Here is the official description of ORA-00001 's problem,

This error means is attempt has been made to insert a record with a duplicate (unique) key. This error would also be generated if a existing the record are updated to generate a duplicate (unique) key. Typically this is a duplicate primary key that but it need not be the primary key.

As mentioned above, this type of problem is mostly caused by the presence of duplicate (unique) key when we insert or record new records. In Weblogic92, when you use the JDBC store to store the session, all sessions are put into a table called wl_servlet_sessions, and now we look at Wl_servlet_sessions, Which columns may cause duplicate key? The structure of the wl_servlet_sessions is as follows:

CREATE TABLE Wl_servlet_sessions
(wl_id VARCHAR2) not NULL,
Wl_context_path VARCHAR2 (m) not NULL,
Wl_is_new char (1),
wl_create_time number (),
wl_is_valid char (1),
wl_session_values LONG raw,< c7/> wl_access_time Number (m),
wl_max_inactive_interval INTEGER,
PRIMARY KEY (wl_id, Wl_context_path)) ;

For different database, the specific table structure please refer to http://e-docs.bea.com/wls/docs92/webapp/sessions.html. From the table structure we can see that WebLogic uses Wl_id,wl_context_path as the joint primary key, because for a session application, his wl_context_path is fixed, So the only wl_id that triggers ORA-00001. So is the insert, or update to cause this problem? WebLogic, update the Sessio, only update session data, will not update its primary key, that is, session update does not cause ORA-00001, the reason can only be insert, that is, try to insert the same wl_ ID data, the problem is raised. Even if the same is the insert operation, the direct cause may be divided into the following situations,

1:weblogic's Bug

2: Application scenario problems (such as load balancer can not guarantee session stick)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.