Skip to content

Commit

Permalink
Removed deprecated transactionContext() from SharedSessionBuilder
Browse files Browse the repository at this point in the history
Signed-off-by: Jan Schatteman <[email protected]>
  • Loading branch information
jrenaat authored and sebersole committed Mar 9, 2022
1 parent b8c4167 commit 6564abe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,6 @@
*/
public interface SharedSessionBuilder<T extends SharedSessionBuilder> extends SessionBuilder<T> {

/**
* Signifies that the transaction context from the original session should be used to create the new session.
*
* @return {@code this}, for method chaining
*
* @deprecated Use {@link #connection()} instead
*/
@Deprecated
default T transactionContext() {
return connection();
}

/**
* Signifies that the connection from the original session should be used to create the new session.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public void testSharedTransactionContextSessionClosing(SessionFactoryScope scope
session.getTransaction().begin();

Session secondSession = session.sessionWithOptions()
.transactionContext()
.connection()
.openSession();
CriteriaBuilder criteriaBuilder = secondSession.getCriteriaBuilder();
CriteriaQuery<IrrelevantEntity> criteria = criteriaBuilder.createQuery( IrrelevantEntity.class );
Expand Down Expand Up @@ -92,7 +92,7 @@ public void testSharedTransactionContextAutoClosing(SessionFactoryScope scope) {
// COMMIT ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Session secondSession = session.sessionWithOptions()
.transactionContext()
.connection()
.autoClose( true )
.openSession();

Expand All @@ -116,7 +116,7 @@ public void testSharedTransactionContextAutoClosing(SessionFactoryScope scope) {
session.getTransaction().begin();

secondSession = session.sessionWithOptions()
.transactionContext()
.connection()
.autoClose( true )
.openSession();

Expand Down Expand Up @@ -160,7 +160,7 @@ public void testSharedTransactionContextFlushBeforeCompletion(SessionFactoryScop
session.getTransaction().begin();

Session secondSession = session.sessionWithOptions()
.transactionContext()
.connection()
// .flushBeforeCompletion( true )
.autoClose( true )
.openSession();
Expand Down

0 comments on commit 6564abe

Please sign in to comment.