mirror of
https://github.com/corda/corda.git
synced 2025-06-14 13:18:18 +00:00
Merge branch 'release/os/4.4' into dan/os-4.4-to-4.5-merge-2020-07-01
# Conflicts: # core/src/main/kotlin/net/corda/core/node/ServiceHub.kt # node/src/integration-test-slow/kotlin/net/corda/node/services/statemachine/StatemachineGeneralErrorHandlingTest.kt # node/src/integration-test-slow/kotlin/net/corda/node/services/statemachine/StatemachineKillFlowErrorHandlingTest.kt # node/src/integration-test/kotlin/net/corda/node/flows/FlowEntityManagerTest.kt # node/src/main/kotlin/net/corda/node/internal/AbstractNode.kt # node/src/main/kotlin/net/corda/node/services/statemachine/TransitionExecutorImpl.kt # node/src/main/kotlin/net/corda/node/services/statemachine/interceptors/HospitalisingInterceptor.kt
This commit is contained in:
@ -6,6 +6,7 @@ import org.hibernate.Session
|
||||
import org.hibernate.Transaction
|
||||
import rx.subjects.PublishSubject
|
||||
import java.sql.Connection
|
||||
import java.sql.SQLException
|
||||
import java.util.UUID
|
||||
import javax.persistence.EntityManager
|
||||
|
||||
@ -87,6 +88,7 @@ class DatabaseTransaction(
|
||||
committed = true
|
||||
}
|
||||
|
||||
@Throws(SQLException::class)
|
||||
fun rollback() {
|
||||
if (sessionDelegate.isInitialized() && session.isOpen) {
|
||||
session.clear()
|
||||
@ -97,16 +99,20 @@ class DatabaseTransaction(
|
||||
clearException()
|
||||
}
|
||||
|
||||
@Throws(SQLException::class)
|
||||
fun close() {
|
||||
if (sessionDelegate.isInitialized() && session.isOpen) {
|
||||
session.close()
|
||||
try {
|
||||
if (sessionDelegate.isInitialized() && session.isOpen) {
|
||||
session.close()
|
||||
}
|
||||
if (database.closeConnection) {
|
||||
connection.close()
|
||||
}
|
||||
} finally {
|
||||
clearException()
|
||||
contextTransactionOrNull = outerTransaction
|
||||
}
|
||||
if (database.closeConnection) {
|
||||
connection.close()
|
||||
}
|
||||
clearException()
|
||||
|
||||
contextTransactionOrNull = outerTransaction
|
||||
if (outerTransaction == null) {
|
||||
synchronized(this) {
|
||||
closed = true
|
||||
|
Reference in New Issue
Block a user