Skip to content

Commit 8eabd3e

Browse files
authored
Merge pull request #50 from GiGainfosystems/fix/impl_is_broken_transaction_manager
Provide a custom implementation of
2 parents c1a229a + b8c7c99 commit 8eabd3e

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

src/oracle/connection/transaction.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,4 +132,17 @@ impl TransactionManager<OciConnection> for OCITransactionManager {
132132
) -> &mut diesel::connection::TransactionManagerStatus {
133133
&mut conn.transaction_manager.status
134134
}
135+
136+
fn is_broken_transaction_manager(conn: &mut OciConnection) -> bool {
137+
let transaction_depth = Self::get_transaction_depth(conn);
138+
139+
match transaction_depth {
140+
Err(_) => true,
141+
Ok(None) => false,
142+
Ok(Some(v)) if conn.transaction_manager.is_test_transaction && u32::from(v) == 1 => {
143+
false
144+
}
145+
Ok(Some(_)) => true,
146+
}
147+
}
135148
}

0 commit comments

Comments
 (0)