Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 1 addition & 12 deletions jta-crash-rec/README-source.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ The `jta-crash-rec` quickstart uses JTA and Byteman to show how to code distribu
:standalone-server-type: full
:archiveType: war
:uses-h2:
:uses-ds-xml:

== What is it?

Expand All @@ -28,7 +27,7 @@ The relational database table in this example contains two columns that represen

In this example, you halt the {productName} server in the middle of an XA transaction after the database modification has been committed, but before the JMS producer is committed. You can verify that the transaction was started, then restart the {productName} server to complete the transaction. You then verify that everything is in a consistent state.

{productName} ships with H2, an in-memory database written in Java. In this example, we use H2 for the database. Although H2 XA support is not recommended for production systems, the example does illustrate the general steps you need to perform for any datasource vendor. This example provides its own H2 XA datasource configuration. It is defined in the `jta-crash-rec-ds.xml` file in the WEB-INF folder of the WAR archive.
{productName} ships with H2, an in-memory database written in Java. In this example, we use H2 for the database. Although H2 XA support is not recommended for production systems, the example does illustrate the general steps you need to perform for any datasource vendor. This example provides its own H2 XA datasource configuration. It is defined by a 'DataSourceDefinition' annotation in the `XAServlet.java` file.

// Link to the quickstart source
include::../shared-doc/view-the-source.adoc[leveloffset=+1]
Expand Down Expand Up @@ -173,16 +172,6 @@ This is normal. What actually happened is that the first resource, `JTACrashRecQ

. Do NOT forget to link:{configureBytemanDisableDocUrl}[Disable the Byteman script] by restoring the backup server configuration file. The Byteman rule must be removed to ensure that your application server will be able to commit 2PC transactions!

== Server Log: Expected Warnings and Errors

You will see the following warnings in the server log. You can ignore these warnings.

[source,options="nowrap"]
----
WFLYJCA0091: -ds.xml file deployments are deprecated. Support may be removed in a future version.
HHH000431: Unable to determine H2 database version, certain features may not work
----

// Server Distribution Testing
include::../shared-doc/run-integration-tests-with-server-distribution.adoc[leveloffset=+1]
// Undeploy the Quickstart
Expand Down
14 changes: 14 additions & 0 deletions jta-crash-rec/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,20 @@
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<archive>
<manifestEntries>
<!-- specifies that the deployment depends on server module com.h2database.h2 -->
<Dependencies>com.h2database.h2</Dependencies>
</manifestEntries>
</archive>
</configuration>
</plugin>
</plugins>
</build>

<profiles>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
*/
package org.jboss.as.quickstarts.xa;

import jakarta.annotation.sql.DataSourceDefinition;
import jakarta.inject.Inject;
import jakarta.servlet.ServletException;
import jakarta.servlet.annotation.WebServlet;
Expand All @@ -38,6 +39,25 @@
* @author Michael Musgrove
*
*/
@DataSourceDefinition(
name="java:jboss/datasources/JTACrashRecQuickstartDS",
className = "org.h2.jdbcx.JdbcDataSource",
url = "jdbc:h2:file:~/jta-crash-rec-quickstart;DB_CLOSE_ON_EXIT=FALSE;DB_CLOSE_DELAY=-1",
user="sa",
password="sa",
properties = {
"is-same-rm-override=false",
"interleaving=true",
"pad-xid=false",
"wrap-xa-resource=true",
"validate-on-match=false",
"background-validation=false",
"background-validation-millis=0",
"prepared-statement-cache-size=0",
"recovery-username=sa",
"recovery-password=sa"
}
)
@SuppressWarnings("serial")
@WebServlet("/XA")
public class XAServlet extends HttpServlet {
Expand Down

This file was deleted.

Loading