Skip to content

Commit 535ca43

Browse files
committed
Inline the internal TransactionIsolation.description() method
1 parent 1ca02d5 commit 535ca43

File tree

2 files changed

+22
-33
lines changed

2 files changed

+22
-33
lines changed

ebean-datasource/src/main/java/io/ebean/datasource/pool/ConnectionPool.java

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@
1414
import java.util.concurrent.atomic.LongAdder;
1515
import java.util.concurrent.locks.ReentrantLock;
1616

17-
import static io.ebean.datasource.pool.TransactionIsolation.description;
18-
1917
/**
2018
* A robust DataSource implementation.
2119
* <ul>
@@ -213,6 +211,28 @@ private void initialiseConnections() throws SQLException {
213211
name, ro, autoCommit, description(transactionIsolation), minConnections, maxConnections, (System.currentTimeMillis() - start), validateOnHeartbeat);
214212
}
215213

214+
/**
215+
* Return the string description of the transaction isolation level specified.
216+
*/
217+
private static String description(int level) {
218+
switch (level) {
219+
case Connection.TRANSACTION_NONE:
220+
return "NONE";
221+
case Connection.TRANSACTION_READ_COMMITTED:
222+
return "READ_COMMITTED";
223+
case Connection.TRANSACTION_READ_UNCOMMITTED:
224+
return "READ_UNCOMMITTED";
225+
case Connection.TRANSACTION_REPEATABLE_READ:
226+
return "REPEATABLE_READ";
227+
case Connection.TRANSACTION_SERIALIZABLE:
228+
return "SERIALIZABLE";
229+
case -1:
230+
return "NotSet";
231+
default:
232+
return "UNKNOWN[" + level + "]";
233+
}
234+
}
235+
216236
/**
217237
* Initialise the database using the owner credentials if we can't connect using the normal credentials.
218238
* <p>

ebean-datasource/src/main/java/io/ebean/datasource/pool/TransactionIsolation.java

Lines changed: 0 additions & 31 deletions
This file was deleted.

0 commit comments

Comments
 (0)