Using the BPEL Designer and Service Engine

Creating an XA Connection Pool and a JDBC Resource


Note –

Before you setup and test the Connection Pools, you must first set the GlassFish JVM classpath for your database JDBC drivers. See Setting the JVM Classpath to the Database JDBC Drivers for more information.


ProcedureTo create an XA Connection Pool:

  1. Log into the GlassFish Admin Console. To do this, right-click your application server node, in the Services window under Servers, and choose View Admin Console.

    You can also open the Admin Console from your web browser using the correct URL. For example: http://localhost:4848.

  2. In the navigation tree, expand the following nodes: Resources -> JDBC.

  3. Select Connection Pools, and in the right panel, click the New button.

  4. Under General Settings, specify a name (such as bpelseDBXA).

  5. Set the Resource Type to javax.sql.XADataSource.

  6. Set the database vendor to the appropriate database vendor (Derby, Oracle or MySQL). Click next.

    Image shows the New Connection Pool window of the GlassFish
Admin Console
  7. From the New JDBC Connection Pool (Step 2 of 2) window, under Connection Validation, enable Allow Non Component Callers.

  8. Under Additional Properties, specify the following properties for your database:

    • Derby:

      • ServerName -> machine-name

      • DatabaseName -> DatabaseName: bpelseDB;create=true

      • User -> bpelse_user

      • Password -> bpelse_user

    • Oracle:

      • URL -> jdbc:oracle:thin:@machine-name:port:sid

      • User -> bpelse_user

      • Password -> bpelse_user

    • MySQL:

      • URL -> jdbc:mysql://machine-name:port/databasename

      • User -> bpelse_user

      • Password -> bpelse_user

    If you did not use the default values, make sure that the ServerName, User, Password and DatabaseName values are those that you specified when you created the database.

  9. Click Finish. The new user and database are created.

  10. Click the connection pool name and click the Ping button to verify your database connection.

  11. Click Finish.

ProcedureCreate a new JDBC resource:

  1. From the Admin Console navigation tree, expand the Resources -> JDBC nodes, and select JDBC Resources.

  2. In the right panel, click the New button.

  3. Provide a JNDIName (such as jdbc/bpelseDB) and specify the JDBC Connection Pool (bplseDB) you created previously. You will use this JNDIName later when you enable persistence in the BPEL Service Engine properties.

  4. Expand the Configuration node and select Transaction Service (or Configuration -> server-config -> Transaction Service, if clustering is configured).

  5. For the On Restart parameter, enable Automatic Recovery by selecting the Enabled check box.