Skip to content

Commit

Permalink
Bump to version 0.2.20-3
Browse files Browse the repository at this point in the history
  • Loading branch information
tom committed Nov 20, 2020
1 parent a2fd785 commit fb16ecd
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@loyaltylion/typeorm",
"private": true,
"version": "0.2.20-2",
"version": "0.2.29-3",
"description": "loyaltylion fork",
"license": "MIT",
"readmeFilename": "README.md",
Expand Down
1 change: 1 addition & 0 deletions src/driver/postgres/PostgresDriver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {Driver} from "../Driver";
import {ConnectionIsNotSetError} from "../../error/ConnectionIsNotSetError";
import {ObjectLiteral} from "../../common/ObjectLiteral";
import {DriverPackageNotInstalledError} from "../../error/DriverPackageNotInstalledError";
import {DriverUtils} from "../DriverUtils";
import {ColumnMetadata} from "../../metadata/ColumnMetadata";
import {PostgresQueryRunner} from "./PostgresQueryRunner";
import {DateUtils} from "../../util/DateUtils";
Expand Down
7 changes: 7 additions & 0 deletions src/query-builder/SelectQueryBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1065,6 +1065,13 @@ export class SelectQueryBuilder<Entity> extends QueryBuilder<Entity> implements

} catch (error) {

// rollback transaction if we started it
if (transactionStartedByUs) {
try {
await queryRunner.rollbackTransaction();
} catch (rollbackError) { }
}
throw error;

} finally {
if (queryRunner !== this.queryRunner) { // means we created our own query runner
Expand Down

0 comments on commit fb16ecd

Please sign in to comment.