Skip to content

BreninSul/configurable-transaction-template-starter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This is small lib for easy configuring Spring TransactionTemplate params for each execution such as readOnly propagation isolation timeout

Configure with properties

Parameter Type Description
spring.transaction.configurable.enabled boolean Enable/disable autoconfig for this starter
spring.transaction.configurable.default.propagation TransactionPropagation Enable/disable autoconfig for this starter
spring.transaction.configurable.default.isolation TransactionIsolation Enable/disable autoconfig for this starter
spring.transaction.configurable.default.read-only boolean Enable/disable autoconfig for this starter
spring.transaction.configurable.default.timeout Duration Enable/disable autoconfig for this starter

Beans in Spring Boot will be automatically registered in ConfigurableTransactionAutoConfiguration with defined properties ConfigurableTransactionTemplateProperties (prefix synchronisation).

add the following dependency:

dependencies {
//Other dependencies
    implementation("io.github.breninsul:configurable-transaction-template-starter:${version}")
//Other dependencies
}

Example of usage

val trxTemplate: ConfigurableTransactionTemplate
trxTemplate.execute(readOnly = true) {
    jdbcClient.sql("do read only sql")
        .update()
}

About

ConfigurableTransactionTemplateStarter

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages