mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-11-17 22:56:28 +00:00
#1245 - Refactor internals - move Transaction ProfileStream creation
Stops the profileId parameter pollution, enables to potentially use transaction label and runtime toggling of collecting transaction profiling detail.
This commit is contained in:
1 parent
a92e620f7e
commit
851f1c98b0
14 files changed
+62
-45
No files matched your search
@@ -177,25 +177,17 @@ public class JdbcTransaction implements SpiTransaction, TxnProfileEventCodes {
|
||||
|
||||
protected DocStoreTransaction docStoreTxn;
|
||||
|
||||
private final ProfileStream profileStream;
|
||||
private ProfileStream profileStream;
|
||||
|
||||
protected ProfileLocation profileLocation;
|
||||
|
||||
protected final long startNanos;
|
||||
|
||||
/**
|
||||
* Create without ProfileStream option (no profiling).
|
||||
*/
|
||||
public JdbcTransaction(String id, boolean explicit, Connection connection, TransactionManager manager) {
|
||||
this(null, id, explicit, connection, manager);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new JdbcTransaction.
|
||||
*/
|
||||
public JdbcTransaction(ProfileStream profileStream, String id, boolean explicit, Connection connection, TransactionManager manager) {
|
||||
public JdbcTransaction(String id, boolean explicit, Connection connection, TransactionManager manager) {
|
||||
try {
|
||||
this.profileStream = profileStream;
|
||||
this.active = true;
|
||||
this.id = id;
|
||||
this.logPrefix = deriveLogPrefix(id);
|
||||
@@ -246,6 +238,11 @@ public class JdbcTransaction implements SpiTransaction, TxnProfileEventCodes {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setProfileStream(ProfileStream profileStream) {
|
||||
this.profileStream = profileStream;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ProfileStream profileStream() {
|
||||
return profileStream;
|
||||
|
||||
Reference in new issue
Block a user