Class DBInternalUtils
- java.lang.Object
-
- jetbrains.buildServer.serverSide.db.DBInternalUtils
-
public class DBInternalUtils extends Object
Static functions for internal usages.Currently this class is public because
GenericQuery
uses this class. In future, this class should be package-visible.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
DBInternalUtils.RawOperation<R>
-
Constructor Summary
Constructors Constructor Description DBInternalUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
closeSilently(Connection connection, Logger logger)
Closes the connection.static void
commit(Connection connection)
static <R> R
rawOperation(DBInternalUtils.RawOperation<R> operation, QueryAndParams qap, DatabaseAccessChecker databaseAccessChecker)
static <R> R
rawOperation(DBInternalUtils.RawOperation<R> operation, QueryAndParams qap, DatabaseAccessChecker databaseAccessChecker, String taskName)
static void
rollback(Connection connection)
static void
rollbackSilently(Connection connection, Logger logger, Throwable originalException)
Performs roll back on the given connection.
-
-
-
Method Detail
-
rawOperation
public static <R> R rawOperation(@NotNull DBInternalUtils.RawOperation<R> operation, @NotNull QueryAndParams qap, @Nullable DatabaseAccessChecker databaseAccessChecker) throws SQLException
- Throws:
SQLException
-
rawOperation
public static <R> R rawOperation(@NotNull DBInternalUtils.RawOperation<R> operation, @NotNull QueryAndParams qap, @Nullable DatabaseAccessChecker databaseAccessChecker, @NotNull String taskName) throws SQLException
- Throws:
SQLException
-
commit
public static void commit(@NotNull Connection connection) throws SQLException
- Throws:
SQLException
-
rollback
public static void rollback(@NotNull Connection connection) throws SQLException
- Throws:
SQLException
-
rollbackSilently
public static void rollbackSilently(@NotNull Connection connection, @NotNull Logger logger, @Nullable Throwable originalException)
Performs roll back on the given connection. Never throws exceptions.- Parameters:
connection
- the connection/session to roll back.logger
- logger where log encountered exception.originalException
- optional original exception, when the roll back is performed because the DB operation failed.- Since:
- 9.0.3
-
closeSilently
public static void closeSilently(@NotNull Connection connection, @NotNull Logger logger)
Closes the connection. Never throws exceptions.- Parameters:
connection
- the connection/session to roll back.logger
- logger where log encontered exception.- Since:
- 9.0.3
-
-