37 lines
3.5 KiB
HTML
37 lines
3.5 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<html>
|
|
<head>
|
|
<META http-equiv="Content-Type" content="text/html; charset=utf-8">
|
|
<LINK rel="stylesheet" type="text/css" href="../../../rzahg/ic.css">
|
|
|
|
<title>Configuring the isolation level on a resource reference</title>
|
|
</head>
|
|
|
|
<BODY>
|
|
<!-- Java sync-link -->
|
|
<SCRIPT LANGUAGE="Javascript" SRC="../../../rzahg/synch.js" TYPE="text/javascript"></SCRIPT>
|
|
|
|
<h5><a name="datasiso"></a>Configuring the isolation level on a resource reference</h5>
|
|
|
|
<p>Specify the appropriate isolation level for each of your resource references. The isolation level is used only by JDBC users.</p>
|
|
|
|
<p>If a JDBC application or a servlet runs in a global transaction, and you are using shareable connections, you cannot set the isolation level on a connection.</p>
|
|
|
|
<!--<p>When a container-managed persistence (CMP) bean uses a new data source to access a back end database, the isolation level is determined by the WebSphere Application Server run time based on the type of access intent that this method or the bean has chosen. All other connection users can also use the access intent and application profile support to manage their concurrency control.</p>-->
|
|
|
|
<p>For all JDBC connections, you can specify a default isolation level on the resource reference. For shareable connections that run in global transactions, this default is the only way to set the isolation level for connections. You cannot directly set the isolation level through the setTransactionIsolation() method on a shareable connection that runs in a global transaction. To use a different isolation level on connections, you must provide a different resource reference.</p>
|
|
|
|
<p>Each resource reference associates with one isolation level. When your application uses this resource reference Java Naming and Directory Interface (JNDI) name to look up a data source, every connection returned from this data source using this resource reference has the same isolation level.</p>
|
|
|
|
<p>Components that need to use shareable connections with multiple isolation levels can create multiple resource references, give them different JNDI names, and have their code look up the appropriate data source for the isolation level they need. In this way, you use separate connections with the different isolation levels enabled on them.</p>
|
|
|
|
<p>It is possible to map these multiple resource references to the same configured data source. The connections still come from the same underlying pool, however, the connection manager does not allow sharing of connections requested by resource references with different isolation levels.</p>
|
|
|
|
<p>For example, a data source is bound to two resource references: jdbc/RRResRef and jdbc/RCResRef. RRResRef has the RepeatableRead isolation level defined . RCResRef has the ReadCommitted isolation level defined. If your application wants to update the tables, it can use the jdbc/RRResRef JNDI name to look up the data source instance. All connections returned from the data source instance have a RepeatableRead isolation level. If the application wants to perform a query for read only, then it is better to use the jdbc/RCResRef JNDI name to look up the data source.</p>
|
|
|
|
<p>You can define multiple resource references for the same servlet. Each resource reference has its own Java Naming and Directory Interface (JNDI) logical name. You can also bind multiple resource references to the same data source. Each JNDI resource reference naming lookup returns the connections from the data source that has the same isolation level.</p>
|
|
|
|
</body>
|
|
</html>
|
|
|