Modified core to support drop and schema-sqlf.sql but leverages derby syntax outside of connection string.

Modified *.properties file to add additional property "batch.isolationlevel=ISOLATION_SERIALIZABLE
because batch-sqlf.properties needs batch.isolationlevel=ISOLATION_READ_COMMITTED.
Added corresponding sqlf properties and sqlf files.
Modified simple-job-launcher-context.xml to support the p:isolationLevelForCreate="${batch.isolationlevel}"
This commit is contained in:
wxlund
2012-12-17 16:34:38 -08:00
committed by Michael Minella
parent d3ff7c7a6e
commit 0d7bf2cd71
13 changed files with 231 additions and 2 deletions

View File

@@ -14,4 +14,5 @@ batch.database.incrementer.parent=columnIncrementerParent
batch.lob.handler.class=org.springframework.jdbc.support.lob.DefaultLobHandler
batch.grid.size=2
batch.jdbc.pool.size=6
batch.verify.cursor.position=false
batch.verify.cursor.position=false
batch.isolationlevel=ISOLATION_SERIALIZABLE

View File

@@ -15,3 +15,4 @@ batch.lob.handler.class=org.springframework.jdbc.support.lob.DefaultLobHandler
batch.grid.size=2
batch.jdbc.pool.size=6
batch.verify.cursor.position=true
batch.isolationlevel=ISOLATION_SERIALIZABLE

View File

@@ -18,3 +18,5 @@ batch.lob.handler.class=org.springframework.jdbc.support.lob.DefaultLobHandler
batch.jdbc.pool.size=6
batch.grid.size=6
batch.verify.cursor.position=true
batch.isolationlevel=ISOLATION_SERIALIZABLE

View File

@@ -15,3 +15,5 @@ batch.lob.handler.class=org.springframework.jdbc.support.lob.DefaultLobHandler
batch.jdbc.pool.size=6
batch.grid.size=50
batch.verify.cursor.position=true
batch.isolationlevel=ISOLATION_SERIALIZABLE

View File

@@ -15,3 +15,5 @@ batch.lob.handler.class=org.springframework.jdbc.support.lob.OracleLobHandler
batch.grid.size=2
batch.jdbc.pool.size=6
batch.verify.cursor.position=true
batch.isolationlevel=ISOLATION_SERIALIZABLE

View File

@@ -0,0 +1,20 @@
# Placeholders batch.*
# for Derby:
batch.jdbc.driver=com.vmware.sqlfire.jdbc.ClientDriver
batch.jdbc.url=jdbc:sqlfire://localhost:1257/;update=true
batch.jdbc.user=SAMPLES
batch.jdbc.password=SAMPLES
batch.jdbc.testWhileIdle=false
batch.jdbc.validationQuery=
batch.jdbc.verifyCursorPosition=false
batch.drop.script=classpath:/org/springframework/batch/core/schema-drop-derby.sql
batch.schema.script=classpath:/org/springframework/batch/core/schema-sqlf.sql
batch.business.schema.script=business-schema-sqlf.sql
batch.data.source.init=true
batch.database.incrementer.class=org.springframework.jdbc.support.incrementer.DerbyMaxValueIncrementer
batch.database.incrementer.parent=columnIncrementerParent
batch.lob.handler.class=org.springframework.jdbc.support.lob.DefaultLobHandler
batch.grid.size=2
batch.jdbc.pool.size=6
batch.verify.cursor.position=false
batch.isolationlevel=ISOLATION_READ_COMMITTED

View File

@@ -15,3 +15,5 @@ batch.database.incrementer.parent=columnIncrementerParent
batch.grid.size=2
batch.jdbc.pool.size=6
batch.verify.cursor.position=true
batch.isolationlevel=ISOLATION_SERIALIZABLE

View File

@@ -15,4 +15,6 @@ batch.database.incrementer.parent=columnIncrementerParent
batch.jdbc.pool.size=6
batch.grid.size=6
batch.verify.cursor.position=true
batch.isolationlevel=ISOLATION_SERIALIZABLE

View File

@@ -0,0 +1,100 @@
-- Autogenerated: do not edit this file
-- You might need to remove this section the first time you run against a clean database
DROP TABLE BATCH_STAGING_SEQ ;
DROP TABLE TRADE_SEQ ;
DROP TABLE CUSTOMER_SEQ ;
DROP TABLE BATCH_STAGING ;
DROP TABLE TRADE ;
DROP TABLE CUSTOMER ;
DROP TABLE PLAYERS ;
DROP TABLE GAMES ;
DROP TABLE PLAYER_SUMMARY ;
DROP TABLE ERROR_LOG ;
-- Autogenerated: do not edit this file
CREATE TABLE CUSTOMER_SEQ (ID BIGINT PRIMARY KEY GENERATED ALWAYS AS IDENTITY (start with 5), DUMMY VARCHAR(1));
CREATE TABLE BATCH_STAGING_SEQ (ID BIGINT PRIMARY KEY GENERATED ALWAYS AS IDENTITY (start with 0), DUMMY VARCHAR(1));
CREATE TABLE TRADE_SEQ (ID BIGINT PRIMARY KEY GENERATED ALWAYS AS IDENTITY (start with 0), DUMMY VARCHAR(1));
CREATE TABLE BATCH_STAGING (
ID BIGINT NOT NULL PRIMARY KEY,
JOB_ID BIGINT NOT NULL,
VALUE BLOB NOT NULL,
PROCESSED CHAR(1) NOT NULL
) ;
CREATE TABLE TRADE (
ID BIGINT NOT NULL PRIMARY KEY,
VERSION BIGINT ,
ISIN VARCHAR(45) NOT NULL,
QUANTITY BIGINT ,
PRICE DECIMAL(8,2) ,
CUSTOMER VARCHAR(45)
) ;
CREATE TABLE CUSTOMER (
ID BIGINT NOT NULL PRIMARY KEY,
VERSION BIGINT ,
NAME VARCHAR(45) ,
CREDIT DECIMAL(10,2)
) ;
INSERT INTO CUSTOMER (ID, VERSION, NAME, CREDIT) VALUES (1, 0, 'customer1', 100000);
INSERT INTO CUSTOMER (ID, VERSION, NAME, CREDIT) VALUES (2, 0, 'customer2', 100000);
INSERT INTO CUSTOMER (ID, VERSION, NAME, CREDIT) VALUES (3, 0, 'customer3', 100000);
INSERT INTO CUSTOMER (ID, VERSION, NAME, CREDIT) VALUES (4, 0, 'customer4', 100000);
--INSERT INTO CUSTOMER (VERSION, NAME, CREDIT) VALUES (0, 'customer1', 100000);
--INSERT INTO CUSTOMER (VERSION, NAME, CREDIT) VALUES (0, 'customer2', 100000);
--INSERT INTO CUSTOMER (VERSION, NAME, CREDIT) VALUES (0, 'customer3', 100000);
--INSERT INTO CUSTOMER (VERSION, NAME, CREDIT) VALUES (0, 'customer4', 100000);
CREATE TABLE PLAYERS (
PLAYER_ID CHAR(8) NOT NULL PRIMARY KEY,
LAST_NAME VARCHAR(35) NOT NULL,
FIRST_NAME VARCHAR(25) NOT NULL,
POS VARCHAR(10) ,
YEAR_OF_BIRTH BIGINT NOT NULL,
YEAR_DRAFTED BIGINT NOT NULL
) ;
CREATE TABLE GAMES (
PLAYER_ID CHAR(8) NOT NULL,
YEAR_NO BIGINT NOT NULL,
TEAM CHAR(3) NOT NULL,
WEEK BIGINT NOT NULL,
OPPONENT CHAR(3) ,
COMPLETES BIGINT ,
ATTEMPTS BIGINT ,
PASSING_YARDS BIGINT ,
PASSING_TD BIGINT ,
INTERCEPTIONS BIGINT ,
RUSHES BIGINT ,
RUSH_YARDS BIGINT ,
RECEPTIONS BIGINT ,
RECEPTIONS_YARDS BIGINT ,
TOTAL_TD BIGINT
) ;
CREATE TABLE PLAYER_SUMMARY (
ID CHAR(8) NOT NULL,
YEAR_NO BIGINT NOT NULL,
COMPLETES BIGINT NOT NULL ,
ATTEMPTS BIGINT NOT NULL ,
PASSING_YARDS BIGINT NOT NULL ,
PASSING_TD BIGINT NOT NULL ,
INTERCEPTIONS BIGINT NOT NULL ,
RUSHES BIGINT NOT NULL ,
RUSH_YARDS BIGINT NOT NULL ,
RECEPTIONS BIGINT NOT NULL ,
RECEPTIONS_YARDS BIGINT NOT NULL ,
TOTAL_TD BIGINT NOT NULL
) ;
CREATE TABLE ERROR_LOG (
JOB_NAME CHAR(20) ,
STEP_NAME CHAR(20) ,
MESSAGE VARCHAR(300) NOT NULL
) ;

View File

@@ -19,7 +19,8 @@
</bean>
<bean id="jobRepository"
class="org.springframework.batch.core.repository.support.JobRepositoryFactoryBean"
class="org.springframework.batch.core.repository.support.JobRepositoryFactoryBean"
p:isolationLevelForCreate = "${batch.isolationlevel}"
p:dataSource-ref="dataSource" p:transactionManager-ref="transactionManager" p:lobHandler-ref="lobHandler"/>
<bean id="mapJobRepository"