customer = CUSTOMER() // New instance of CUSTOMER table component customer.id = "1234" // sets value of primary key attribute logMessage "Customer Name=" + customer.name // this triggers an implicit call to "load()"
customer = CUSTOMER() // New instance of CUSTOMER table component customer.id = "1234" // sets value of primary key attribute customer.accessDatabase = false // disable auto-loading // Note: "customer.name" evaluates to null (row not auto-loaded) customer.load() // load row explicitly logMessage "Customer Name=" + customer.name
The Process Execution Engine manages and pools the connections to the database servers automatically.
From PBL code you don't explicitly open or close JDBC connections. When your PBL code instantiates a SQL component, the Engine automatically assigns a connection to that database from the pool. When all SQL components for that database get out of scope, the Engine releases the connection back to the pool.
SQL Components connecting to the same database within the same transaction share a single connection.
The Process Execution Engine always executes PBL code in the context of a transaction. In general, PBL code is called from a process activity, and the execution of the activity task defines the transaction boundaries.
From PBL code you don't explicitly start, commit or rollback a database transaction. When your PBL code first instantiates a SQL component, the Engine automatically starts a transaction on that database.
When the execution of a PBL script succeeds (no Exceptions thrown), the Engine commits all associated database transactions. When the execution of a PBL script fails (an Exception is thrown or predefined variable action indicates so) the Engine rolls back all associated database transactions.
When the Process Exception Engine runs on an EJB container (such as Oracle WebLogic or IBM WebSphere) and all JDBC data sources involved are configured to be "XA" (for distributed transactions), then database connections will participate on the same global transaction managed by the container.
SQL components can only execute in the context of the Process Execution Engine.
If you are using SQL components from a BPM object method, you should set property Service Side Method of your method to Yes.
Server-side methods cannot be invoked directly from BPM Object Presentations. If you need to access SQL components from a Presentation, extract the code that uses SQL into a separate method, make this new method Server Side and call it from the original client-side method.