java - Derby doesn't allow isolation level to be set at TRANSACTION_SERIALIZABLE for concurrent access -


i'm using derby database , trying create db objects concurrently.

as know default isolation level in transaction_read_committed.

but don't want allow phantom reads db , hence, want set isolation level transaction_serializable.

all bit of code.

if(jdbctemplate.getdatasource().getconnection().gettransactionisolation() == connection.transaction_read_committed) {                 logger.info("the connection isolation transaction_read_committed");             }             else {                 logger.info("please set connection isolation transaction_read_committed");             }              jdbctemplate.getdatasource().getconnection().settransactionisolation(connection.transaction_serializable);             if(jdbctemplate.getdatasource().getconnection().gettransactionisolation() == connection.transaction_serializable) {                 logger.info("the connection isolation transaction_serializable");             } 

as expected, see log "the connection isolation transaction_read_committed", surprisingly dont see log "the connection isolation transaction_serializable".

also exception expecting occurs confirms isolation level not set serializable.


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -