aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/io/trygvis/spring
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2013-04-20 15:43:01 +0200
committerTrygve Laugstøl <trygvis@inamo.no>2013-04-20 15:43:01 +0200
commit637dddf11f5d60b35c9696914e1e2658b2ddc611 (patch)
treeef320c1950d78163dd0cc3247bee172f4e3e32ff /src/main/java/io/trygvis/spring
parentc274d9177e4a495e7b793120dfd1ce12fa5632c7 (diff)
downloadquartz-based-queue-637dddf11f5d60b35c9696914e1e2658b2ddc611.tar.gz
quartz-based-queue-637dddf11f5d60b35c9696914e1e2658b2ddc611.tar.bz2
quartz-based-queue-637dddf11f5d60b35c9696914e1e2658b2ddc611.tar.xz
quartz-based-queue-637dddf11f5d60b35c9696914e1e2658b2ddc611.zip
wip
Diffstat (limited to 'src/main/java/io/trygvis/spring')
-rwxr-xr-xsrc/main/java/io/trygvis/spring/Config.java14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/main/java/io/trygvis/spring/Config.java b/src/main/java/io/trygvis/spring/Config.java
index 5df4dac..5dd845f 100755
--- a/src/main/java/io/trygvis/spring/Config.java
+++ b/src/main/java/io/trygvis/spring/Config.java
@@ -11,6 +11,7 @@ import org.springframework.context.annotation.*;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.support.*;
import org.springframework.data.jpa.repository.config.*;
+import org.springframework.jdbc.core.*;
import org.springframework.jdbc.datasource.*;
import org.springframework.orm.hibernate4.*;
import org.springframework.orm.jpa.*;
@@ -18,12 +19,13 @@ import org.springframework.transaction.*;
import org.springframework.transaction.annotation.*;
import org.springframework.transaction.support.*;
-import java.util.*;
import javax.persistence.*;
import javax.sql.*;
+import java.util.*;
import static org.hibernate.cfg.AvailableSettings.*;
import static org.hibernate.ejb.AvailableSettings.*;
+import static org.springframework.transaction.TransactionDefinition.*;
@Configuration
@ComponentScan(basePackages = "io.trygvis")
@@ -40,6 +42,11 @@ public class Config {
}};
}
+ @Bean
+ public JdbcTemplate jdbcTemplate(DataSource dataSource) {
+ return new JdbcTemplate(dataSource);
+ }
+
// public SpringBeanJobFactory springBeanJobFactory() {
// SpringBeanJobFactory factory = new SpringBeanJobFactory();
// return factory;
@@ -164,6 +171,9 @@ public class Config {
@Bean
public TransactionTemplate transactionTemplate(PlatformTransactionManager platformTransactionManager) {
- return new TransactionTemplate(platformTransactionManager);
+ DefaultTransactionDefinition td = new DefaultTransactionDefinition();
+ td.setPropagationBehavior(PROPAGATION_REQUIRED);
+ td.setIsolationLevel(ISOLATION_READ_COMMITTED);
+ return new TransactionTemplate(platformTransactionManager, td);
}
}