cinqict

Thursday, February 20, 2014

JTA TLOG in database

Out-of-the box, Weblogic places the transaction log (tlog) in the Default Persistent Store.
If you want to enable Automatic Service Migration for JTA, the Default Persistent Store, which is file based by default, must be on a location to which all managed servers (JTA Candidate Servers for fail over) have access. One solution might be to place the Default Persistent Store on a shared file system. Another one is to place the tlog in the database.
Note; This feature is available from weblogic 11.1.1.6 onward.

Step 2: Select Migration Basis for your Cluster

Go to Clusters > Configuration > Migration and set the Migration Basis for your cluster.
In this example, Consensus is used, which means that the NodeManager is responsible for leasing (in memory).



Step 2: Create a NON-XA Datasource










Deselect Support Global Transactions :


Provide credentials, test the datasource and target the datasource to your cluster.
Finally, Activate your changes.


Step 3: Point JTA Service to Datasource

One by one, select each server for your cluster and go to ConfigurationServices:



Under Transaction Log Store:
Change Type to JDBC
Select the created DataSource
Provide a prefix (server specific)



Note: There is no need to create tables on the database; Weblogic will create these on server startup!


Save your changes in this page and go to Configuration > Migration.
Enable Automatic JTA Migration and select the Candidate servers:


Finally, Activate your changes and restart your cluster.

When starting the managed servers, the log shows that the JDBC Store uses the datasource to open the table:

<JDBC store "java_01JTA_JDBCTLOGStore" opened table "TLOG_java_01_WLStore" and loaded 0 records. For additional JDBC store information, use the diagnostics framework while the JDBC store is open.>

If one server crashes, (one of ) the other candidate server(s) will pick up the transaction log to handle the transactions.

Step 4: Verification
Verify that the tables are created when the cluster is restarted:



No comments:

Post a Comment