Skip to content

Oracle Schema #881

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

Closed
pminearo opened this issue Sep 18, 2017 · 1 comment
Closed

Oracle Schema #881

pminearo opened this issue Sep 18, 2017 · 1 comment
Assignees

Comments

@pminearo
Copy link

We are using:
Spring Session 1.3.1
Spring Security 4.3.2
Oracle 12g

I got an error, "Can not insert null SPRING_SESSION.SPRING_SESSION_PK". This can easily be resolved by adding a Sequence and a trigger for Oracle.

CREATE SEQUENCE "SPRING_SESSION_SEQ"
	minvalue 1024
	nomaxvalue
	increment by 1
	start with 1024
	cache 1000
	noorder
	nocycle;
	
create or replace trigger SPRING_SESSION_TRG
before insert on SPRING_SESSION
for each row
when (new.PRIMARY_ID is null)
begin
	select SPRING_SESSION_SEQ.nextval into :new.PRIMARY_ID from DUAL;
end;

web.xml

<filter>
	<filter-name>springSessionRepositoryFilter</filter-name>
	<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
</filter>
<filter-mapping>
	<filter-name>springSessionRepositoryFilter</filter-name>
	<url-pattern>/*</url-pattern>
	<dispatcher>REQUEST</dispatcher>
	<dispatcher>ERROR</dispatcher>
</filter-mapping>
<filter>
	<filter-name>springSecurityFilterChain</filter-name>
	<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
</filter>
<filter-mapping>
	<filter-name>springSecurityFilterChain</filter-name>
	<url-pattern>/*</url-pattern>
</filter-mapping>
<listener>
	<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>

applicationContext.xml

<context:annotation-config/>
<bean class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
	<constructor-arg ref="dataSource"/>
</bean>
<bean class="org.springframework.session.jdbc.config.annotation.web.http.JdbcHttpSessionConfiguration"/>
@vpavic vpavic self-assigned this Sep 18, 2017
@vpavic
Copy link
Contributor

vpavic commented Sep 18, 2017

@pminearo You are using Spring Session 1.3.1.RELEASE but it appears you are using schema script from the master branch. The primary_id column which causes your problems was introduced as a part of #835 and that functionality will be a part of the upcoming Spring Session 2.0.

Please make sure that you are using schema script contained within the Spring Session JAR you are using.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants