Skip to content
This repository was archived by the owner on Oct 21, 2024. It is now read-only.

Commit 00dde8c

Browse files
authored
fix test connect method in dao oracledb
1 parent 72f420c commit 00dde8c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/dal/dao/dao-oracledb.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,13 @@ export class DaoOracledb implements IDaoInterface {
588588
async testConnect(): Promise<ITestConnectResult> {
589589
const knex = this.configureKnex(this.connection);
590590
try {
591-
const result = await knex('DUAL').select(1);
591+
result = await knex
592+
.transaction((trx) => {
593+
knex.raw(`SELECT 1 FROM DUAL`).transacting(trx).then(trx.commit).catch(trx.rollback);
594+
})
595+
.catch((e) => {
596+
throw new Error(e);
597+
});
592598
if (result) {
593599
return {
594600
result: true,

0 commit comments

Comments
 (0)