Using a full Oracle Database with BPEL PM
Clemens Utschig has blogged about how to use the Oracle DB XE with BPEL developer install. I have seen a couple of queries about this recently and thought it was worth repeating what Clement had said. This is the configuration in which I run my BPEL installation on my laptop.
- Install Oracle Database
Should work with most versions, note that only certain DB versions are "certified" for use with BPEL, meaning they are tested and supported by Oracle. - Install BPEL developer on PC
This will install Oracle Lite and configure the developer version to use this, we will fix this in a minute.
Assume that we installed BPEL into $ORACLE_HOME then the $BPEL_HOME referred to in this entry will be $ORACLE_HOME/integration/orabpel - Create a user on the DB with connect and resource priviliges
Using sqlplus connect to the database as user system or sys and create a user, the actual username and password doesn't matter. Life will be easier if you start sqlplus from the $BPEL_HOME/system/database/scripts/server directorysqlplus system/manager@ORCL
create user bpel101202 identified by bpel101202;
grant connect, resource to bpel101202; - Install BPEL schema into DB using scripts in $BPEL_HOME/system/database/scripts/server
Use your sqlplus session to login as the user you created (bpel101202 in our example) and execute the two scripts server_oracle.ddl and domain_oracle.ddlconnect bpel101202/bpel101202
@server_oracle.ddl
@domain_oracle.ddl - Modify
$BPEL_HOME/system/appserver/oc4j/j2ee/home/config/data-sources.xml
to point at the database instead of OLite.
Comment out the two Oracle Lite entries in the file<!-- Use these datasources to connect to Oracle Lite -->
<!--
<data-source class="com.evermind.sql.DriverManagerDataSource"
name="BPELServerDataSource"
location="jdbc/BPELServerDataSourceWorkflow"
xa-location="BPELServerDataSource"
ejb-location="jdbc/BPELServerDataSource"
connection-driver="oracle.lite.poljdbc.POLJDBCDriver"
username="system"
password="any"
max-connections="30"
min-connections="10"
connection-retry-interval="30"
max-connect-attempts="10"
url="jdbc:polite4@127.0.0.1:100:orabpel"/>
<data-source class="com.evermind.sql.DriverManagerDataSource"
name="BPELSamplesDataSource"
location="jdbc/BPELSamplesDataSource"
xa-location="BPELSamplesDataSource"
ejb-location="jdbc/BPELSamplesDataSource"
connection-driver="oracle.lite.poljdbc.POLJDBCDriver"
username="system"
password="any"
max-connections="5"
min-connections="2"
connection-retry-interval="30"
max-connect-attempts="10"
url="jdbc:polite4@127.0.0.1:100:orabpel"/>
<data-source class="com.evermind.sql.DriverManagerDataSource"
name="AdminConsoleDateSource"
location="jdbc/AdminConsoleDateSource"
xa-location="AdminConsoleDateSource"
ejb-location="jdbc/AdminConsoleDateSource"
connection-driver="oracle.lite.poljdbc.POLJDBCDriver"
username="system"
password="any"
max-connections="80"
min-connections="2"
connection-retry-interval="30"
max-connect-attempts="10"
url="jdbc:polite4@127.0.0.1:100:orabpel"/>
-->Uncomment the Oracle 9i entries in the file (also works fine with 10g) and modify the three (3) entries to point to your database.<!-- Use this datasource to connect to Oracle 9i -->
<data-source class="com.evermind.sql.DriverManagerDataSource"
name="BPELServerDataSource"
location="jdbc/BPELServerDataSourceWorkflow"
xa-location="BPELServerDataSource"
ejb-location="jdbc/BPELServerDataSource"
connection-driver="oracle.jdbc.OracleDriver"
max-connections="150"
min-connections="10"
connection-retry-interval="30"
max-connect-attempts="10"
url="jdbc:oracle:thin:orabpel101202/orabpel101202@localhost:1521:ORCL"/>
<data-source class="com.evermind.sql.DriverManagerDataSource"
name="BPELSamplesDataSource"
location="jdbc/BPELSamplesDataSource"
xa-location="BPELSamplesDataSource"
ejb-location="jdbc/BPELSamplesDataSource"
connection-driver="oracle.jdbc.OracleDriver"
max-connections="150"
min-connections="10"
connection-retry-interval="30"
max-connect-attempts="10"
url="jdbc:oracle:thin:orabpel101202/orabpel101202@localhost:1521:ORCL"/>
<data-source class="com.evermind.sql.DriverManagerDataSource"
name="AdminConsoleDateSource"
location="jdbc/AdminConsoleDateSource"
xa-location="AdminConsoleDateSource"
ejb-location="jdbc/AdminConsoleDateSource"
connection-driver="oracle.jdbc.OracleDriver"
max-connections="80"
min-connections="2"
connection-retry-interval="30"
max-connect-attempts="10"
url="jdbc:oracle:thin:orabpel101202/orabpel101202@localhost:1521:ORCL"/>
If it doesn't work and you get strange errors most likely cause is the data-sources.xml has not been edited correctly so shutdown BPEL PM, check your data-sources.xml and try again.
Note that in a production environment you may well run BPEL Process Manager inside a full application server (say an Oracle App Server mid-tier install) and so could use the nice GUI tools to change datasources. Also it is worth pointing out that if you are using BPEL in a production environment then you should use it with a version of the database that BPEL PM has been certified with.
Important Note: A brilliant product manager (Sandor Nieuwenhuijs) just pointed out that in 10gR2 database create view is no longer granted as part of the connect role so you need to explicitly grant create view to bpel101202 user along with granting connect and resource priviliges.