-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Spring Session Oracle jdbc temp space issue ORA-01652 #1321
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
To elaborate more, We have enabled debug for spring session and following are the logs, which clearly tells that we are copying bytes into temporary lob. Can anyone please explain what would be the process for clean up.? 2019-01-22 12:31:24.273 DEBUG [org.springframework.jdbc.core.JdbcTemplate] [http-nio-8080-exec-5] [f64b111d-217f-4984-83c1-9111e0ed557c] Executing prepared SQL statement [UPDATE CONSUMER_SESSION_ATTRIBUTES SET ATTRIBUTE_BYTES = ? WHERE SESSION_ID = ? AND ATTRIBUTE_NAME = ?] |
Thanks for the report @chkrishna411. Could you provide more details about your environment - specifically which versions of Spring Framework, Oracle database and Oracle JDBC driver do you use? There have been a few similar reports against Spring Framework's JDBC support albeit very long time ago - see spring-projects/spring-framework#10666 and spring-projects/spring-framework#10877. Note thought, that @Bean
public LobHandler springSessionLobHandler() {
OracleLobHandler lobHandler = new OracleLobHandler();
lobHandler.setReleaseResourcesAfterRead(true);
return lobHandler;
} Also note that in Spring Session we're using |
We are using, It looks like OracleLobHandler is deprecated in spring-jdbc:4.3.12 version. After debugging, it seems like, spring session is using DefaultLobHandler for Create Lob's. We will test with OracleLobHandler. will there be anything else that we need to consider if we are using deprecated OracleLobHandler.? |
Thanks for following up @chkrishna411. Yes, as mentioned in my previous comment, the
Could you also provide the information about Oracle JDBC driver version you use, as requested in the previous comment? If you're using a recent release of Oracle JDBC driver, this perhaps looks like a Spring Framework's JDBC support issue. |
We are using 12.1.0.1 JDBC Driver. |
Did you manage to give |
We have tried using OracleLobHandler, but it didn't help. We have created almost 120,000 sessions in in our QA environment to simulate the issue. When we checked with DBA team, we have used almost 16GB, and it was not released. |
Thanks for the feedback @chkrishna411. Just to confirm, you did use |
Any feedback @chkrishna411? There's little we at the Session side can do, if anything this looks like a Framework issue, but before opening issue there I'd first like to confirm that you've tried using |
Closing due to lack of feedback. Please comment back if you can provide more details and we can re-open the issue. |
#1654 got to the bottom of this. |
We are using spring-session with jdbc backed by Oracle database.
we are using 1.3.4 version of spring-session.
compile "org.springframework.session:spring-session-jdbc:1.3.4.RELEASE"
compile "org.springframework.session:spring-session:1.3.4.RELEASE"
We are seeing temp space being utilized heavily by spring-session and it's keep on increasing gradually. It's not cleaning up automatically and after 2 to 3 days, it has consumed the entire TEMP space and our app was going down.
After researching on oracle database side, it looks like the following outer join query is the one which is using temporary LOB.
private static final String GET_SESSION_QUERY =
"SELECT S.SESSION_ID, S.CREATION_TIME, S.LAST_ACCESS_TIME, S.MAX_INACTIVE_INTERVAL, SA.ATTRIBUTE_NAME, SA.ATTRIBUTE_BYTES " +
"FROM %TABLE_NAME% S " +
"LEFT OUTER JOIN %TABLE_NAME%_ATTRIBUTES SA ON S.SESSION_ID = SA.SESSION_ID " +
"WHERE S.SESSION_ID = ?";
Once after killing those sessions directly from database, entire temp space usage came down to 0.
Failed Logs in the application:
org.springframework.jdbc.UncategorizedSQLException: PreparedStatementCallback; uncategorized SQLException for SQL [UPDATE SPRING_SESSION_ATTRIBUTES SET ATTRIBUTE_BYTES = ? WHERE SESSION_ID = ? AND ATTRIBUTE_NAME = ?]; SQL state [72000]; error code [1652]; ORA-01652: unable to extend temp segment by 128 in tablespace TEMP
; nested exception is java.sql.SQLException: ORA-01652: unable to extend temp segment by 128 in tablespace TEMP
The text was updated successfully, but these errors were encountered: