Skip to content

Commit 0e83628

Browse files
lpradelvladmihalcea
authored andcommitted
HHH-11546 Add support for SAP NetWeaver as JTA Platform
1 parent 6ec060b commit 0e83628

File tree

6 files changed

+56
-0
lines changed

6 files changed

+56
-0
lines changed

documentation/src/main/asciidoc/userguide/chapters/transactions/Transactions.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ Hibernate provides many implementations of the `JtaPlatform` contract, all with
8181
`OC4J`:: `JtaPlatform` for Oracle's OC4J container.
8282
`Orion`:: `JtaPlatform` for the Orion Application Server.
8383
`Resin`:: `JtaPlatform` for the Resin Application Server.
84+
`SapNetWeaver`:: `JtaPlatform` for the SAP NetWeaver Application Server.
8485
`SunOne`:: `JtaPlatform` for the SunOne Application Server.
8586
`Weblogic`:: `JtaPlatform` for the Weblogic Application Server.
8687
`WebSphere`:: `JtaPlatform` for older versions of the WebSphere Application Server.

documentation/src/main/docbook/devguide-old/en-US/chapters/services/Services.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,13 @@
505505
Can also be referenced using the <property>Resin</property> configuration short name
506506
</para>
507507
</listitem>
508+
<listitem>
509+
<para>
510+
<classname>org.hibernate.engine.transaction.jta.platform.internal.SapNetWeaverJtaPlatform</classname> -
511+
Integration with transaction manager as deployed in a SAP NetWeaver application server.
512+
Can also be referenced using the <property>SapNetWeaver</property> configuration short name
513+
</para>
514+
</listitem>
508515
<listitem>
509516
<para>
510517
<classname>org.hibernate.engine.transaction.jta.platform.internal.SunOneJtaPlatform</classname> -

documentation/src/main/docbook/manual-old/en-US/content/bootstrap.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -505,6 +505,11 @@
505505
<literal>Resin</literal> - JtaPlatform for the Resin Application Server.
506506
</para>
507507
</listitem>
508+
<listitem>
509+
<para>
510+
<literal>SapNetWeaver</literal> - JtaPlatform for the SAP NetWeaver Application Server.
511+
</para>
512+
</listitem>
508513
<listitem>
509514
<para>
510515
<literal>SunOne</literal> - JtaPlatform for the SunOne Application Server.

documentation/src/main/docbook/userGuide/en-US/chapters/transactions/Transactions.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,11 @@
177177
<literal>Resin</literal> - JtaPlatform for the Resin Application Server.
178178
</para>
179179
</listitem>
180+
<listitem>
181+
<para>
182+
<literal>SapNetWeaver</literal> - JtaPlatform for the SAP NetWeaver Application Server.
183+
</para>
184+
</listitem>
180185
<listitem>
181186
<para>
182187
<literal>SunOne</literal> - JtaPlatform for the SunOne Application Server.

hibernate-core/src/main/java/org/hibernate/boot/registry/selector/internal/StrategySelectorBuilder.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@
7777
import org.hibernate.engine.transaction.jta.platform.internal.OC4JJtaPlatform;
7878
import org.hibernate.engine.transaction.jta.platform.internal.OrionJtaPlatform;
7979
import org.hibernate.engine.transaction.jta.platform.internal.ResinJtaPlatform;
80+
import org.hibernate.engine.transaction.jta.platform.internal.SapNetWeaverJtaPlatform;
8081
import org.hibernate.engine.transaction.jta.platform.internal.SunOneJtaPlatform;
8182
import org.hibernate.engine.transaction.jta.platform.internal.WebSphereExtendedJtaPlatform;
8283
import org.hibernate.engine.transaction.jta.platform.internal.WebSphereJtaPlatform;
@@ -314,6 +315,13 @@ private void addJtaPlatforms(StrategySelectorImpl strategySelector) {
314315
"org.hibernate.service.jta.platform.internal.ResinJtaPlatform"
315316
);
316317

318+
addJtaPlatforms(
319+
strategySelector,
320+
SapNetWeaverJtaPlatform.class,
321+
"SapNetWeaver",
322+
"org.hibernate.service.jta.platform.internal.SapNetWeaverJtaPlatform"
323+
);
324+
317325
addJtaPlatforms(
318326
strategySelector,
319327
SunOneJtaPlatform.class,
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/*
2+
* Hibernate, Relational Persistence for Idiomatic Java
3+
*
4+
* License: GNU Lesser General Public License (LGPL), version 2.1 or later.
5+
* See the lgpl.txt file in the root directory or <http://www.gnu.org/licenses/lgpl-2.1.html>.
6+
*/
7+
package org.hibernate.engine.transaction.jta.platform.internal;
8+
9+
import javax.transaction.TransactionManager;
10+
import javax.transaction.UserTransaction;
11+
12+
/**
13+
* {@link org.hibernate.engine.transaction.jta.platform.spi.JtaPlatform} implementation for SAP NetWeaver
14+
*
15+
* @author Lukas Pradel
16+
*/
17+
public class SapNetWeaverJtaPlatform extends AbstractJtaPlatform {
18+
public static final String TM_NAME = "TransactionManager";
19+
public static final String UT_NAME = "UserTransaction";
20+
21+
@Override
22+
protected TransactionManager locateTransactionManager() {
23+
return (TransactionManager) jndiService().locate( TM_NAME );
24+
}
25+
26+
@Override
27+
protected UserTransaction locateUserTransaction() {
28+
return (UserTransaction) jndiService().locate( UT_NAME );
29+
}
30+
}

0 commit comments

Comments
 (0)