JDBC transaction isolation
Isolation levels are:
commited, repeatable read, uncomitted and serializable.
As a Java programmer, where will we specify these attributes?
kasim wrote:
I am using just JDBC, when i program using JDBC where i need to specify these?Sorry about the previous comment. I couldn't resist.
Anyway, see java.sql.Connection and set/get TransactionIsolation: http://java.sun.com/javase/6/docs/api/java/sql/Connection.html
Similar Messages
-
Setting JDBC Transaction Isolation
https://community.jboss.org/wiki/ConfigDataSources
As explained in the above URL, with JBoss, you can set the JDBC transaction isolation level in the xml file that contains the JDBC connection information.
I've been doing some googling, but I'm not clear on how this can be done with WebLogic. Is there some kind of external file where you can set the JDBC transaction isolation level as with JBoss, or is this some kind of change that can only be made in the application code or in some file contained within the application archive file (ear, war, etc.)?You can set the isolation in the deployment override weblogic-ejb-jar.xml
- http://docs.oracle.com/cd/E21764_01/web.1111/e13719/ejb_jar_ref.htm#i1116237
- http://docs.oracle.com/cd/E21764_01/web.1111/e13719/ejb_jar_ref.htm#i1219612 -
Bug in Oracle's handling of transaction isolation levels?
Hello,
I think there is a bug in Oracle 9i database related to serializable transaction isolation level.
Here is the information about the server:
Operating System: Microsoft Windows 2000 Server Version 5.0.2195 Service Pack 2 Build 2195
System type: Single CPU x86 Family 6 Model 8 Stepping 10 GenuineIntel ~866 MHz
BIOS-Version: Award Medallion BIOS v6.0
Locale: German
Here is my information about the client computer:
Operaing system: Microsoft Windows XP
System type: IBM ThinkPad
Language for DB access: Java
Database information:
Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.1.0 - Production
The database has been set up using the default settings and nothing has been changed.
To reproduce the bug, follow these steps:
1. Create a user in 9i database called 'kaon' with password 'kaon'
2. Using SQL Worksheet create the following table:
CREATE TABLE OIModel (
modelID int NOT NULL,
logicalURI varchar (255) NOT NULL,
CONSTRAINT pk_OIModel PRIMARY KEY (modelID),
CONSTRAINT logicalURI_OIModel UNIQUE (logicalURI)
3. Run the following program:
package test;
import java.sql.*;
public class Test {
public static void main(String[] args) throws Exception {
java.util.Locale.setDefault(java.util.Locale.US);
Class.forName("oracle.jdbc.OracleDriver");
Connection connection=DriverManager.getConnection("jdbc:oracle:thin:@schlange:1521:ORCL","kaon","kaon");
DatabaseMetaData dmd=connection.getMetaData();
System.out.println("Product version:");
System.out.println(dmd.getDatabaseProductVersion());
System.out.println();
connection.setAutoCommit(false);
connection.setTransactionIsolation(Connection.TRANSACTION_SERIALIZABLE);
int batches=0;
int counter=2000;
for (int outer=0;outer<50;outer++) {
for (int i=0;i<200;i++) {
executeUpdate(connection,"INSERT INTO OIModel (modelID,logicalURI) VALUES ("+counter+",'start"+counter+"')");
executeUpdate(connection,"UPDATE OIModel SET logicalURI='next"+counter+"' WHERE modelID="+counter);
counter++;
connection.commit();
System.out.println("Batch "+batches+" done");
batches++;
protected static void executeUpdate(Connection conn,String sql) throws Exception {
Statement s=conn.createStatement();
try {
int result=s.executeUpdate(sql);
if (result!=1)
throw new Exception("Should update one row, but updated "+result+" rows, query is "+sql);
finally {
s.close();
The program prints the following output:
Product version:
Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.1.0 - Production
Batch 0 done
Batch 1 done
java.lang.Exception: Should update one row, but updated 0 rows, query is UPDATE OIModel SET logicalURI='next2571' WHERE modelID=2571
at test.Test.executeUpdate(Test.java:35)
at test.Test.main(Test.java:22)
That is, after several iterations, the executeUpdate() method returns 0, rather than 1. This is clearly an error.
4. Leave the database as is. Replace the line
int counter=2000;
with line
int counter=4000;
and restart the program. The following output is generated:
Product version:
Oracle9i Enterprise Edition Release 9.2.0.1.0 - Production
With the Partitioning, OLAP and Oracle Data Mining options
JServer Release 9.2.0.1.0 - Production
Batch 0 done
Batch 1 done
java.sql.SQLException: ORA-08177: can't serialize access for this transaction
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)
at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:573)
at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1891)
at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:1093)
at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:2047)
at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:1940)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2709)
at oracle.jdbc.driver.OracleStatement.executeUpdate(OracleStatement.java:796)
at test.Test.executeUpdate(Test.java:33)
at test.Test.main(Test.java:22)
This is clearly an error - only one transaction is being active at the time, so there is no need for serialization of transactions.
5. You can restart the program as many times you wish (by chaging the initial counter value first). The same error (can't serialize access for this transaction) will be generated.
6. The error doesn't occur if the transaction isolation level isn't changed.
7. The error doesn't occur if the UPDATE statement is commented out.
Sincerely yours
Boris MotikI have a similar problem
I'm using Oracle and serializable isolation level.
Transaction inserts 4000 objects and then updates about 1000 of these objects.
Transactions sees inserted objects but cant update them (row not found or can't serialize access for this transaction are thrown).
On 3 tries for this transaction 1 succeds and 2 fails with one of above errors.
No other transactions run concurently.
In read commited isolation error doesn't arise.
I'm using plain JDBC.
Similar or even much bigger serializable transaction works perfectly on the same database as plsql procedure.
I've tried oci and thin (Oracle) drivers and oranxo demo (i-net) driver.
And this problems arises on all of this drivers.
This problem confused me so much :(.
Maby one of Oracle users, developers nows cause of this strange behaviour.
Thanx for all answers. -
Issues with transaction isolation levels (BEA-631 exceptions)
My intended EJB application will have a session bean that uses two very similar entity beans that will be mapped to different databases; in my test version the entity beans use the same database.
The final application will need XA transactions with isolation=serializable (beans may be in Oracle, DB2, or MSSQL databases); high probability of concurrent potentially interfering transactions.
My test example works (Windows XP, WebLogic 8.1, Oracle 9.2) with both BEA's Oracle driver, and the Oracle driver but only when I set a transaction isolation on the session bean as the Oracle specific "transactionreadcommitedforupdate".
If I try using "transactionserializable", I get an exception like the following when my session-bean first tries to find an entity bean:
<2/09/2005 10:13:43 AM EST> <Warning> <Common> <BEA-000631> <Unknown resource "weblogic.jdbc.common.internal.ConnectionEnv@1f13e99" being released to pool "BEAOraclePool". Printing out current pool contents.>
(similar response with both drivers).
Please could someone explain what is wrong and why setting isolation serializable causes problems. How
should I fix things?Hi. What version of 8.1 is this?
If you can easily reproduce this
we may either have a fix, or will
want to debug this.
Joe
Neil Gray wrote:
The bit about "cleaning up vendor connections" was from the comment by Imeshev that was earlier in this thread.
The context:
Application does involve possibility of two concurrent transactions trying to change the same row of a datatable; as isolation level is repeatableread or serializable, this will result in some exceptions. Sometimes exceptions handled ok, sometimes they cause problems.
Particular case illustrated below is when working with DB2. As I understand it, the two concurrent EJBs both make read requests (presumably acquiring read locks) then make update requests - if they happen to share a row this will block. I don't know enough about DB2 to know what controls its detection of problems. In practice I see db2 typically sending back an error to one of requestors in less than 1 second, but sometimes several seconds may elapse before the error response gets sent (I have observ
ed actual net traffic).
If transaction gets timed out in WebLogic (I've curently got a generous 8 second timeout setting in JTA tab) then there are problems.
First of two exceptions shown here is for normal case where db2 returned an error and it was handled ok:
11111111111111111
####<30/09/2005 10:55:39 AM EST> <Error> <EJB> <ATP-NL2-RS3> <examplesServer> <ExecuteThread: '12' for queue: 'weblogic.kernel.Default'> <<anonymous>> <> <BEA-010026> <Exception occurred during commit of transaction Name=[EJB db2transferapp.TransferBean.doTransfer(java.lang.String,java.lang.String,java.math.BigDecimal)],Xid=BEA1-1D5B56A9177C58E3D95B(17477508),Status=Rolled back. [Reason=weblogic.utils.NestedRuntimeException: Error writing from beforeCompletion - with nested exception:
[weblogic.jdbc.base.BaseBatchUpdateException: [BEA][DB2 JDBC Driver]Abnormal end unit of work condition occurred.]],numRepliesOwedMe=0,numRepliesOwedOthers=0,seconds since begin=0,seconds left=10,XAServerResourceInfo[BEADB2]=(ServerResourceInfo[BEADB2]=(state=rolledback,assigned=examplesServer),xar=BEADB2,re-Registered = false),SCInfo[examples+examplesServer]=(state=rolledback),properties=({weblogic.transaction.name=[EJB db2transferapp.TransferBean.doTransfer(java.lang.String,java.lang.String,java.math.Bi
gDecimal)], ISOLATION LEVEL=4}),local properties=({modifiedListeners=[weblogic.ejb20.internal.TxManager$TxListener@eed1b8]}),OwnerTransactionManager=ServerTM[ServerCoordinatorDescriptor=(CoordinatorURL=examplesServer+203.143.168.208:7001+examples+t3+, XAResources={},NonXAResources={})],CoordinatorURL=examplesServer+203.143.168.208:7001+examples+t3+): weblogic.jdbc.base.BaseBatchUpdateException: [BEA][DB2 JDBC Driver]Abnormal end unit of work condition occurred.
at weblogic.jdbc.db2.DB2ImplStatement.executeBatch(Unknown Source)
at weblogic.jdbc.base.BaseStatement.commonExecute(Unknown Source)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
--------------- nested within: ------------------
weblogic.utils.NestedRuntimeException: Error writing from beforeCompletion - with nested exception:
[weblogic.jdbc.base.BaseBatchUpdateException: [BEA][DB2 JDBC Driver]Abnormal end unit of work condition occurred.]
at weblogic.ejb20.internal.TxManager$TxListener.beforeCompletion(TxManager.java:673)
at weblogic.transaction.internal.ServerSCInfo.callBeforeCompletions(ServerSCInfo.java:1010)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
--------------- nested within: ------------------
weblogic.transaction.RollbackException: Unexpected exception in beforeCompletion: sync=weblogic.ejb20.internal.TxManager$TxListener@eed1b8
Error writing from beforeCompletion - with nested exception:
[weblogic.utils.NestedRuntimeException: Error writing from beforeCompletion - with nested exception:
[weblogic.jdbc.base.BaseBatchUpdateException: [BEA][DB2 JDBC Driver]Abnormal end unit of work condition occurred.]]
at weblogic.transaction.internal.TransactionImpl.throwRollbackException(TransactionImpl.java:1683)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
.>
222222222222222
Second case is where timeout in WebLogic occurred (I think) which leads to something messing up the connection pool
####<30/09/2005 10:56:24 AM EST> <Warning> <Common> <ATP-NL2-RS3> <examplesServer> <ExecuteThread: '12' for queue: 'weblogic.kernel.Default'> <<anonymous>> <BEA1-22BE56A9177C58E3D95B> <BEA-000631> <Unknown resource "weblogic.jdbc.common.internal.ConnectionEnv@1551d57" being released to pool "BEADB2". Printing out current pool contents.>
####<30/09/2005 10:56:24 AM EST> <Warning> <Common> <ATP-NL2-RS3> <examplesServer> <ExecuteThread: '12' for queue: 'weblogic.kernel.Default'> <<anonymous>> <> <BEA-000631> <Unknown resource "weblogic.jdbc.common.internal.ConnectionEnv@1551d57" being released to pool "BEADB2". Printing out current pool contents.>
####<30/09/2005 10:56:24 AM EST> <Warning> <Common> <ATP-NL2-RS3> <examplesServer> <ExecuteThread: '12' for queue: 'weblogic.kernel.Default'> <<anonymous>> <> <BEA-000631> <Unknown resource "weblogic.jdbc.common.internal.ConnectionEnv@f95d4a" being released to pool "BEADB2". Printing out current pool contents.>
####<30/09/2005 10:56:24 AM EST> <Error> <EJB> <ATP-NL2-RS3> <examplesServer> <ExecuteThread: '14' for queue: 'weblogic.kernel.Default'> <<anonymous>> <> <BEA-010026> <Exception occurred during commit of transaction Name=[EJB db2transferapp.TransferBean.doTransfer(java.lang.String,java.lang.String,java.math.BigDecimal)],Xid=BEA1-22BD56A9177C58E3D95B(18185360),Status=Rolled back. [Reason=weblogic.transaction.internal.TimedOutException: Transaction timed out after 8 seconds
Name=[EJB db2transferapp.TransferBean.doTransfer(java.lang.String,java.lang.String,java.math.BigDecimal)],Xid=BEA1-22BD56A9177C58E3D95B(18185360),Status=Active (PrePreparing),numRepliesOwedMe=0,numRepliesOwedOthers=0,seconds since begin=8,seconds left=10,activeThread=Thread[ExecuteThread: '14' for queue: 'weblogic.kernel.Default',5,Thread Group for Queue: 'weblogic.kernel.Default'],XAServerResourceInfo[BEADB2]=(ServerResourceInfo[BEADB2]=(state=started,assigned=none),xar=BEADB2,re-Registered = false),SCIn
fo[examples+examplesServer]=(state=pre-preparing),properties=({weblogic.transaction.name=[EJB db2transferapp.TransferBean.doTransfer(java.lang.String,java.lang.String,java.math.BigDecimal)], ISOLATION LEVEL=4}),local properties=({modifiedListeners=[weblogic.ejb20.internal.TxManager$TxListener@1f2a681], weblogic.jdbc.jta.BEADB2=weblogic.jdbc.wrapper.TxInfo@1a4ef37}),OwnerTransactionManager=ServerTM[ServerCoordinatorDescriptor=(CoordinatorURL=examplesServer+203.143.168.208:7001+examples+t3+, XAResources={},
NonXAResources={})],CoordinatorURL=examplesServer+203.143.168.208:7001+examples+t3+)],numRepliesOwedMe=0,numRepliesOwedOthers=0,seconds since begin=9,seconds left=9,XAServerResourceInfo[BEADB2]=(ServerResourceInfo[BEADB2]=(state=rolledback,assigned=examplesServer),xar=BEADB2,re-Registered = false),SCInfo[examples+examplesServer]=(state=rolledback),properties=({weblogic.transaction.name=[EJB db2transferapp.TransferBean.doTransfer(java.lang.String,java.lang.String,java.math.BigDecimal)], ISOLATION LEVEL=4})
,local properties=({modifiedListeners=[]}),OwnerTransactionManager=ServerTM[ServerCoordinatorDescriptor=(CoordinatorURL=examplesServer+203.143.168.208:7001+examples+t3+, XAResources={},NonXAResources={})],CoordinatorURL=examplesServer+203.143.168.208:7001+examples+t3+): weblogic.transaction.internal.TimedOutException: Transaction timed out after 8 seconds
Name=[EJB db2transferapp.TransferBean.doTransfer(java.lang.String,java.lang.String,java.math.BigDecimal)],Xid=BEA1-22BD56A9177C58E3D95B(18185360),Status=Active (PrePreparing),numRepliesOwedMe=0,numRepliesOwedOthers=0,seconds since begin=8,seconds left=10,activeThread=Thread[ExecuteThread: '14' for queue: 'weblogic.kernel.Default',5,Thread Group for Queue: 'weblogic.kernel.Default'],XAServerResourceInfo[BEADB2]=(ServerResourceInfo[BEADB2]=(state=started,assigned=none),xar=BEADB2,re-Registered = false),SCIn
fo[examples+examplesServer]=(state=pre-preparing),properties=({weblogic.transaction.name=[EJB db2transferapp.TransferBean.doTransfer(java.lang.String,java.lang.String,java.math.BigDecimal)], ISOLATION LEVEL=4}),local properties=({modifiedListeners=[weblogic.ejb20.internal.TxManager$TxListener@1f2a681], weblogic.jdbc.jta.BEADB2=weblogic.jdbc.wrapper.TxInfo@1a4ef37}),OwnerTransactionManager=ServerTM[ServerCoordinatorDescriptor=(CoordinatorURL=examplesServer+203.143.168.208:7001+examples+t3+, XAResources={},
NonXAResources={})],CoordinatorURL=examplesServer+203.143.168.208:7001+examples+t3+)
at weblogic.transaction.internal.ServerTransactionImpl.wakeUp(ServerTransactionImpl.java:1614)
at weblogic.transaction.internal.ServerTransactionManagerImpl.processTimedOutTransactions(ServerTransactionManagerImpl.java:1117)
at weblogic.transaction.internal.TransactionManagerImpl.wakeUp(TransactionManagerImpl.java:1881)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
--------------- nested within: ------------------
weblogic.transaction.RollbackException: Transaction timed out after 8 seconds
Name=[EJB db2transferapp.TransferBean.doTransfer(java.lang.String,java.lang.String,java.math.BigDecimal)],Xid=BEA1-22BD56A9177C58E3D95B(18185360),Status=Active (PrePreparing),numRepliesOwedMe=0,numRepliesOwedOthers=0,seconds since begin=8,seconds left=10,activeThread=Thread[ExecuteThread: '14' for queue: 'weblogic.kernel.Default',5,Thread Group for Queue: 'weblogic.kernel.Default'],XAServerResourceInfo[BEADB2]=(ServerResourceInfo[BEADB2]=(state=started,assigned=none),xar=BEADB2,re-Registered = false),SCIn
fo[examples+examplesServer]=(state=pre-preparing),properties=({weblogic.transaction.name=[EJB db2transferapp.TransferBean.doTransfer(java.lang.String,java.lang.String,java.math.BigDecimal)], ISOLATION LEVEL=4}),local properties=({modifiedListeners=[weblogic.ejb20.internal.TxManager$TxListener@1f2a681], weblogic.jdbc.jta.BEADB2=weblogic.jdbc.wrapper.TxInfo@1a4ef37}),OwnerTransactionManager=ServerTM[ServerCoordinatorDescriptor=(CoordinatorURL=examplesServer+203.143.168.208:7001+examples+t3+, XAResources={},
NonXAResources={})],CoordinatorURL=examplesServer+203.143.168.208:7001+examples+t3+) - with nested exception:
[weblogic.transaction.internal.TimedOutException: Transaction timed out after 8 seconds
Name=[EJB db2transferapp.TransferBean.doTransfer(java.lang.String,java.lang.String,java.math.BigDecimal)],Xid=BEA1-22BD56A9177C58E3D95B(18185360),Status=Active (PrePreparing),numRepliesOwedMe=0,numRepliesOwedOthers=0,seconds since begin=8,seconds left=10,activeThread=Thread[ExecuteThread: '14' for queue: 'weblogic.kernel.Default',5,Thread Group for Queue: 'weblogic.kernel.Default'],XAServerResourceInfo[BEADB2]=(ServerResourceInfo[BEADB2]=(state=started,assigned=none),xar=BEADB2,re-Registered = false),SCIn
fo[examples+examplesServer]=(state=pre-preparing),properties=({weblogic.transaction.name=[EJB db2transferapp.TransferBean.doTransfer(java.lang.String,java.lang.String,java.math.BigDecimal)], ISOLATION LEVEL=4}),local properties=({modifiedListeners=[weblogic.ejb20.internal.TxManager$TxListener@1f2a681], weblogic.jdbc.jta.BEADB2=weblogic.jdbc.wrapper.TxInfo@1a4ef37}),OwnerTransactionManager=ServerTM[ServerCoordinatorDescriptor=(CoordinatorURL=examplesServer+203.143.168.208:7001+examples+t3+, XAResources={},
NonXAResources={})],CoordinatorURL=examplesServer+203.143.168.208:7001+examples+t3+)]
at weblogic.transaction.internal.TransactionImpl.throwRollbackException(TransactionImpl.java:1683)
at weblogic.transaction.internal.ServerTransactionImpl.internalCommit(ServerTransactionImpl.java:325)
at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:178)
.>
Once start getting those things released to pool the application falls apart. Shortly afterwards it loses all connections to DB2 (and DB2 may be left with some locks on the table that have to be cleared).
It isn't DB2 specific, if needed I can supply similar data for MSSQL server (BEA or MS drivers) -
About Transaction Isolation Levels...
Hi Everyone,
Please, i have a couple of questions regarding the Transaction Isolation Level, i will really appreciate any help on this...
1.- It is possible to know the transaction isolation level of all connections to the DB.??.. something like a select from v$session...
2.- I have an application that manage it's own connection pool and have set all of its connections to Transaction_read_commited. The problem is that for some reason, sometimes we get the "ORA-08177: can't serialize access for this transaction." Error. But what i know is that this ORA-08177 error only happens if the transaction isolation level is set to TRANSACTION_SERIALIZABLE. How can be that possible??. There is another application running that points to the same database that maybe uses TRANSACTION_SERIALIZABLE connections but even if this is happening, why the error is happening with my application!!?. Both applications are running on the same weblogic application server with oracle thin jdbc driver... (Oracle 9i)
Thanks in advance...
Victor.thanks for the answers guys... i was reding several articles by Tom and also looking into Metalink documents... but my concern or my million dollar question is still: if exists the possibility to get the ORA-8177 error, even if i'm using Transaction isolation level READ_COMMITED???... what i learned from this articles is that if i use the Transaction SERIALIZABLE i may have this ORA-8177.. otherwise i wouldn't. right?... and if exists bugs related all that bugs may exists only if i define my connection as TRANSACTION_SERIALIZABLE.
I'm pretty sure that in my application ("Application A") i'm not using any TRANSACTION_SERIALIZABLE connections.... but i'm afraid that the other application ("Application B") is causing some blocks or conflicts with "Application A"... Is that possible?? (i think that in theory it's not)... But still if that's possible.. i return to my question... Why that ORA-8177 error raises on my "Application A".... this kind of error must be raising only in the "application B"....
Well maybe is something confusing.. an maybe is totally related to some developing mistake.... i just wanted to confirm some other point of views....
thanks again!!..
Victor -
Setting transaction isolation levels in WAS5
I think I'm missing something pretty easy. How can I set the isolation
levels for the containter managed transactions on my beans?
Specifically, I want to set soem lookup methods on my Sessions beans
to TRANSACTION_REPEATABLE_READ. I've already put the
container-transaction blocks in my ejb-jar.xml
Does Websphere 5 have something akin to WebLogic's
weblogic-ejb-jar.xml where you can set additional parameters like
this? Do I have to use a tool like WSAD to specify this? The AAT
doesn't seem to have this option.
Thanks,
James LynnHi Slava, Ryan,
We haven't looked at 8.1 yet since our release cycle wouldn't allow us
to move to 8.1 until at least June anyway, but even if the problems was
fixed there it took BEA support more than 6 months (I opened the case on
Sep 23 2002 and only this week I got the patch that I haven't even tried
to test to see if it works) to issue a patch for such a small problem.
The server would just check if the Oracle XA driver was being used and
no matter what version would just throw an exception if you try to set
the transaction isolation level saying that the feature in the Oracle
8.1.7 driver was broken... (although you might be using 9.x or even a
pre-8.1.7 driver)...
So this is about it.
And Slava, I've tried pushing a case harder only to end up with BEA
support trying to convince me that I was misinterpreting the JDBC spec
when it was not true, so I just gave up. The main goal of BEA support in
all of our experience has been that they don't try to solve the cases
but close them.
That's my and some of my colleagues personal views anyway, you don't
have to share them.
Regards,
Dejan
Slava Imeshev wrote:
Hi Deyan,
Sorry for the delay. Could you give us more details about CR090104?
I've got some feedback in XA area, not sure if it was a related case.
Also, I've never had any problems with weblogic CCE, so you may want
to push your case a little harder.
As per the bold statement - the initial question was about functionality
available in weblogic but not available in websphere - it can't be more
bold :)
Regards,
Slava Imeshev
"Deyan D. Bektchiev" <[email protected]> wrote in message
news:[email protected]...
This is a very bold statement Slava, considering that with Oracle XA
driver you cannot even set the transaction isolation level because of a
Weblogic bug (CR090104 that has been open for more than 6 months
already)...
Dejan
Slava Imeshev wrote:
Hi James,
"James F'jord Lynn" <[email protected]> wrote in message
news:[email protected]...
I think I'm missing something pretty easy. How can I set the isolation
levels for the containter managed transactions on my beans?
Specifically, I want to set soem lookup methods on my Sessions beans
to TRANSACTION_REPEATABLE_READ. I've already put the
container-transaction blocks in my ejb-jar.xml
Does Websphere 5 have something akin to WebLogic's
weblogic-ejb-jar.xml where you can set additional parameters like
this? Do I have to use a tool like WSAD to specify this? The AAT
doesn't seem to have this option.
My guess here is that it's a signal that this is a last chance
for you to abandon WebSphere and return back to WebLogic's
safe harbor.
Regards,
Slava Imeshev -
Regarding Transaction Isolation Level
We talk about query and update constent problem again. even I don't take it as problem.
I can see this in SAP notes or SAP help:
JDBC Sender Adapter...
· The UPDATE statement must alter exactly those data records that have been selected by the SELECT statement. You can ensure this is the case by using an identical WHERE clause. (See Processing Parameters, SQL Statement for Query, and SQL Statement for Update below).
· Processing can only be performed correctly when the Transaction Isolation Level is set to repeatable_read or serializable.
If I set transaction isolation level as default, then how can I make sure ' default' is repeatable_read or serializable?
Our DB is Informix.Hey
Please go through the below blog and see if it helps
/people/yining.mao/blog/2006/09/13/tips-and-tutorial-for-sender-jdbc-adapter
Thanks
Aamir -
XI JDBC adapter isolation level serializable - Not working properly????
Hi all,
I have a JDBC sender adapter which perform in Transaction isolation Method serializable(Advance Mode settings) but it seems that it updates the wrong records witch results in records no to be send in XI.
the select statement I am using is
select OwnerCode,DeliveryNo , ErpWarehouseCode, TrtCode, PostGIdate, PostGIdateChangedFlg, DocumentNo, DocumentDate, CancelFlg, PostGIFlg, TacticalRouteCode, LicenceNo, PackagesQty, CusPickUpFlg, CusPickUpChangedFlg, RouteChangedFlg, DlvPriority, PickingDate, PickingDateChangedFlg, DlvPriorityChangedFlg, OdtLineNumber, ItemCode, WmsStatusCode, Lot, ExpirationDate,ProductionDate, TraUnitQty, TraUnitCode, Qty, MainUnitCode, ConvFactor, ConvDivisor, InitQty, DocQty, DeleteLineFlg, ParentLineNumber, ItemType, CusPickUpDescr, CusPickUpChangedFlg2
from wmsConfDlv2ERP
where flg = 0 and
DeliveryNo in ( select top 1 DeliveryNo from wmsConfDlv2ERP where flg = 0 )
and the update is
UPDATE wmsConfDlv2ERP set flg = -1
where flg = 0 and
DeliveryNo in ( select top 1 DeliveryNo from wmsConfDlv2ERP where flg = 0 )
Any ideas? The DB is an MS SQL 2005... Thanks.Hi,
As far as I know, the JDBC adapter does not support nested queries (just my experience). I always used SPs to properly handle the situation and flow logic.
VJ -
Setting transaction isolation level rises ORA-02089 error
Hello
We have configured a distributed transaction in our application server and
we are using openjpa 1.2.1 and Glassfish application server and Oracle 11g as DB server. Although the default behavior of transaction locking must be optimistic,
it seems that pessimistic locking has been happened.
It is found that Row Lock contention happens in a specific table.
This is the exception :
java.sql.SQLException: ORA-02049: timeout: distributed transaction waiting for lock
Already all the following properties have been set for openjpa.
1. <persistence-unit name="JPXA" transation-type="JTA">
2. <property name="openjpa.TransactionMode" value="managed"/>
You can try a plug-in string to lookup the TM in JNDI (the value is the JNDI name of GlassFish TM as per Google search)
3. <property name="openjpa.ManagedRuntime"
value="jndi(TransactionManagerName=java:appserver/TransactionManager)"/>
Following searching about this locking problem, we found that we should add two more properties for openjpa as listed below.
<property name="openjpa.LockManager" value="version" />
<property name="openjpa.jdbc.TransactionIsolation" value="read-committed" />
but this time by setting the transaction isolation level, we have got another error: org.apache.openjpa.persistence.PersistenceException: ORA-02089: COMMIT is not allowed in a subordinate session.
Thanks for any help.
Regards,
SargolHello
We have configured a distributed transaction in our application server and
we are using openjpa 1.2.1 and Glassfish application server and Oracle 11g as DB server. Although the default behavior of transaction locking must be optimistic,
it seems that pessimistic locking has been happened.
It is found that Row Lock contention happens in a specific table.
This is the exception :
java.sql.SQLException: ORA-02049: timeout: distributed transaction waiting for lock
Already all the following properties have been set for openjpa.
1. <persistence-unit name="JPXA" transation-type="JTA">
2. <property name="openjpa.TransactionMode" value="managed"/>
You can try a plug-in string to lookup the TM in JNDI (the value is the JNDI name of GlassFish TM as per Google search)
3. <property name="openjpa.ManagedRuntime"
value="jndi(TransactionManagerName=java:appserver/TransactionManager)"/>
Following searching about this locking problem, we found that we should add two more properties for openjpa as listed below.
<property name="openjpa.LockManager" value="version" />
<property name="openjpa.jdbc.TransactionIsolation" value="read-committed" />
but this time by setting the transaction isolation level, we have got another error: org.apache.openjpa.persistence.PersistenceException: ORA-02089: COMMIT is not allowed in a subordinate session.
Thanks for any help.
Regards,
Sargol -
How to change the transaction isolation level of a CMP?
How to change the transaction isolation level of a CMP from SUN's Deployment Tool? So far I can't find any entry for this setting.
Anuradha W wrote:
That means, currently the only way tospecify the transaction level is through
weblogic-ejb-jar.xml deployment descriptor?
for WLS-generated code, yes.Somewhat related to this question, we have written a standalone testcase to reproduce this issue we have been having. Basically, the issue is that even though we configure the isolation level to a non-default one in the deployment descriptor, the connections returned by the datasource seem to be having the default (which is Read Committed). The DBMS is DB2.
weblogic-ejb-jar.xml has the following set:
<isolation-level>TransactionRepeatableRead</isolation-level>
And we printed the isolation level of the connection returned from a method in the EJB, but the isolation level is still the default. I can share the code to reproduce the problem if you want to take a look at it. Please let me know how I can get that across to you.
Thanks,
AnuradhaIf you are using our JDBC driver for DB2, or can switch to it,
just for a test, there is some debug I'd like from you.
Joe -
How to Set the Transaction Isolation Level in WebLogic?
Is there a way to set the transaction isolation level in WebLogic 9.2 or WebLogic 10?
For an example say, we have an application which is supported for several database platforms. Without setting the transaction isolation level in DBMS level, is there a way to specify this in WebLogic to make it common for all the DBMS type?
And I found a way to change the transaction isolation level in WebSphere application server using a property called webSphereDefaultIsolationLevel.
[url http://www-1.ibm.com/support/docview.wss?rs=180&uid=swg21224492]http://www-1.ibm.com/support/docview.wss?rs=180&uid=swg21224492
Is there a way to do the same thing in WebLogic application server 9.2 or 10?Anuradha W wrote:
That means, currently the only way tospecify the transaction level is through
weblogic-ejb-jar.xml deployment descriptor?
for WLS-generated code, yes.Somewhat related to this question, we have written a standalone testcase to reproduce this issue we have been having. Basically, the issue is that even though we configure the isolation level to a non-default one in the deployment descriptor, the connections returned by the datasource seem to be having the default (which is Read Committed). The DBMS is DB2.
weblogic-ejb-jar.xml has the following set:
<isolation-level>TransactionRepeatableRead</isolation-level>
And we printed the isolation level of the connection returned from a method in the EJB, but the isolation level is still the default. I can share the code to reproduce the problem if you want to take a look at it. Please let me know how I can get that across to you.
Thanks,
AnuradhaIf you are using our JDBC driver for DB2, or can switch to it,
just for a test, there is some debug I'd like from you.
Joe -
How to set Transaction isolation level in Weblogic 11g
How do I set the transaction isolation level in Weblogic?
Some references that I found suggest that I have to explicitely state the isolation level in the weblogic-ejb-jar.xml per ejb. If I am using EJB 3.0 why would I need to do that?
Can I set this up as a property in the JDBC datasource setup?
Other application servers like Websphere actually allows for this. Can this be done in Weblogic?
Currently I get the following message if I don't set the isolation level:
Transaction attribute: TX_NOT_SUPPORTED Isolation Level: No Isolation Level Set Tx Timeout: 30000
What seems to be happening is that one update of my transaction is getting rolled back and other consequent calls are failing due to foreign key issues due to the first rollback.
I think the issue is related to the isolation level or the transaction time out being too low.
Any ideas?
BTW: I am using openjpa and using a MS SQLServer. Not sure if that helps the discussion.
Thanks
Edited by: rrivera on Jun 2, 2010 9:18 AMHow do I set the transaction isolation level in Weblogic?
Some references that I found suggest that I have to explicitely state the isolation level in the weblogic-ejb-jar.xml per ejb. If I am using EJB 3.0 why would I need to do that?
Can I set this up as a property in the JDBC datasource setup?
Other application servers like Websphere actually allows for this. Can this be done in Weblogic?
Currently I get the following message if I don't set the isolation level:
Transaction attribute: TX_NOT_SUPPORTED Isolation Level: No Isolation Level Set Tx Timeout: 30000
What seems to be happening is that one update of my transaction is getting rolled back and other consequent calls are failing due to foreign key issues due to the first rollback.
I think the issue is related to the isolation level or the transaction time out being too low.
Any ideas?
BTW: I am using openjpa and using a MS SQLServer. Not sure if that helps the discussion.
Thanks
Edited by: rrivera on Jun 2, 2010 9:18 AM -
Hi !
I've been developping a simple webapplication with a few Entity CMP EJB, Struts
and some JSP.
I registred a Pointbase XA JDBC driver in Weblogic 8.1.
When I want to create a new post in the database via one of my EJB, I get "Due
to vendor limitations, setting transaction isolation upon enlistment for "Pointbase
XA" JDBC XA driver is not supported".
What do I have to add in my xml files to make it work ?
Something with <transaction-isolation> in the weblogic-ejb-jar.xml ?
I'll appreciate some help here...
Extract of my code (CustomerEditAction.java):
<<
CustomerHomeLocal chome = (CustomerHomeLocal) Locator.getHome("CustomerHomeLocal");
prop = chome.create(cform.getName(), cform.getAddress(), cform.getZipcode(), cform.getCity(),cform.getCountry(),
cform.getEmail(), cform.getPhone(), cform.getHomepage());
And the error message and stack is:
<<
javax.ejb.TransactionRolledbackLocalException: EJB Exception:; nested exception
is: javax.ejb.EJBException: nested exception is: java.sql.SQLException: XA error:
XAER_RMERR : A resource manager error has occured in the transaction branch start()
failed on resource 'CaciPool - Pointbase - XA': XAER_RMERR : A resource manager
error has occured in the transaction branch javax.transaction.xa.XAException:
start failed for XAResource 'CaciPool - Pointbase - XA': Due to vendor limitations,
setting transaction isolation upon enlistment for "PointBase XA" JDBC XA driver
is not supported. at weblogic.jdbc.wrapper.XA.createException(XA.java:104) at
weblogic.jdbc.jta.DataSource.start(DataSource.java:631) at weblogic.transaction.internal.XAServerResourceInfo.start(XAServerResourceInfo.java:1069)
at weblogic.transaction.internal.XAServerResourceInfo.xaStart(XAServerResourceInfo.java:1001)
at weblogic.transaction.internal.XAServerResourceInfo.enlist(XAServerResourceInfo.java:203)
at weblogic.transaction.internal.ServerTransactionImpl.enlistResource(ServerTransactionImpl.java:419)
at weblogic.jdbc.jta.DataSource.enlist(DataSource.java:1230) at weblogic.jdbc.jta.DataSource.refreshXAConnAndEnlist(DataSource.java:1193)
at weblogic.jdbc.jta.DataSource.getConnection(DataSource.java:371) at weblogic.jdbc.jta.DataSource.connect(DataSource.java:329)
at weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSource.java:298)
at weblogic.ejb20.cmp.rdbms.RDBMSPersistenceManager.getConnection(RDBMSPersistenceManager.java:1841)
at weblogic.ejb20.cmp.rdbms.RDBMSPersistenceManager.execGenKeyNamedSequenceTableUpdateAndQuery(RDBMSPersistenceManager.java:2392)
at weblogic.ejb20.cmp.rdbms.RDBMSPersistenceManager.getNextGenKeyPreFetch(RDBMSPersistenceManager.java:2174)
at weblogic.ejb20.cmp.rdbms.RDBMSPersistenceManager.getNextGenKeyNamedSequenceTable(RDBMSPersistenceManager.java:2147)
at com.caci.ejb.CustomerEJB_6i2zhv__WebLogic_CMP_RDBMS.ejbCreate(CustomerEJB_6i2zhv__WebLogic_CMP_RDBMS.java:5403)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324) at weblogic.ejb20.manager.DBManager.create(DBManager.java:1139)
at weblogic.ejb20.manager.DBManager.localCreate(DBManager.java:1118) at weblogic.ejb20.internal.EntityEJBLocalHome.create(EntityEJBLocalHome.java:171)
at com.caci.ejb.CustomerEJB_6i2zhv_LocalHomeImpl.create(CustomerEJB_6i2zhv_LocalHomeImpl.java:133)
at com.caci.ui.CustomerEditAction.execute(CustomerEditAction.java:58) at
>>
Regards,
OlivierHi !
I've been developping a simple webapplication with a few Entity CMP EJB, Struts
and some JSP.
I registred a Pointbase XA JDBC driver in Weblogic 8.1.
When I want to create a new post in the database via one of my EJB, I get "Due
to vendor limitations, setting transaction isolation upon enlistment for "Pointbase
XA" JDBC XA driver is not supported".
What do I have to add in my xml files to make it work ?
Something with <transaction-isolation> in the weblogic-ejb-jar.xml ?
I'll appreciate some help here...
Extract of my code (CustomerEditAction.java):
<<
CustomerHomeLocal chome = (CustomerHomeLocal) Locator.getHome("CustomerHomeLocal");
prop = chome.create(cform.getName(), cform.getAddress(), cform.getZipcode(), cform.getCity(),cform.getCountry(),
cform.getEmail(), cform.getPhone(), cform.getHomepage());
And the error message and stack is:
<<
javax.ejb.TransactionRolledbackLocalException: EJB Exception:; nested exception
is: javax.ejb.EJBException: nested exception is: java.sql.SQLException: XA error:
XAER_RMERR : A resource manager error has occured in the transaction branch start()
failed on resource 'CaciPool - Pointbase - XA': XAER_RMERR : A resource manager
error has occured in the transaction branch javax.transaction.xa.XAException:
start failed for XAResource 'CaciPool - Pointbase - XA': Due to vendor limitations,
setting transaction isolation upon enlistment for "PointBase XA" JDBC XA driver
is not supported. at weblogic.jdbc.wrapper.XA.createException(XA.java:104) at
weblogic.jdbc.jta.DataSource.start(DataSource.java:631) at weblogic.transaction.internal.XAServerResourceInfo.start(XAServerResourceInfo.java:1069)
at weblogic.transaction.internal.XAServerResourceInfo.xaStart(XAServerResourceInfo.java:1001)
at weblogic.transaction.internal.XAServerResourceInfo.enlist(XAServerResourceInfo.java:203)
at weblogic.transaction.internal.ServerTransactionImpl.enlistResource(ServerTransactionImpl.java:419)
at weblogic.jdbc.jta.DataSource.enlist(DataSource.java:1230) at weblogic.jdbc.jta.DataSource.refreshXAConnAndEnlist(DataSource.java:1193)
at weblogic.jdbc.jta.DataSource.getConnection(DataSource.java:371) at weblogic.jdbc.jta.DataSource.connect(DataSource.java:329)
at weblogic.jdbc.common.internal.RmiDataSource.getConnection(RmiDataSource.java:298)
at weblogic.ejb20.cmp.rdbms.RDBMSPersistenceManager.getConnection(RDBMSPersistenceManager.java:1841)
at weblogic.ejb20.cmp.rdbms.RDBMSPersistenceManager.execGenKeyNamedSequenceTableUpdateAndQuery(RDBMSPersistenceManager.java:2392)
at weblogic.ejb20.cmp.rdbms.RDBMSPersistenceManager.getNextGenKeyPreFetch(RDBMSPersistenceManager.java:2174)
at weblogic.ejb20.cmp.rdbms.RDBMSPersistenceManager.getNextGenKeyNamedSequenceTable(RDBMSPersistenceManager.java:2147)
at com.caci.ejb.CustomerEJB_6i2zhv__WebLogic_CMP_RDBMS.ejbCreate(CustomerEJB_6i2zhv__WebLogic_CMP_RDBMS.java:5403)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324) at weblogic.ejb20.manager.DBManager.create(DBManager.java:1139)
at weblogic.ejb20.manager.DBManager.localCreate(DBManager.java:1118) at weblogic.ejb20.internal.EntityEJBLocalHome.create(EntityEJBLocalHome.java:171)
at com.caci.ejb.CustomerEJB_6i2zhv_LocalHomeImpl.create(CustomerEJB_6i2zhv_LocalHomeImpl.java:133)
at com.caci.ui.CustomerEditAction.execute(CustomerEditAction.java:58) at
>>
Regards,
Olivier -
EJB transaction isolation not working
I'm trying to use TRANSACTION_SERIALIZABLE isolation level in my EJB test application
with no success so far.
The environment is Windows NT, WebLogic 6.1, Informix DB (which, according to
its documentation, supports TRANSACTION_SERIALIZABLE), and a Tx Data Source on
a JDBC pool.
I have an CMP Entity EJB with the following definitions:
<container-transaction>
<method>
<ejb-name>SdrFA</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
<transaction-isolation>
<isolation-level>TRANSACTION_SERIALIZABLE</isolation-level>
<method>
<ejb-name>SdrFA</ejb-name>
<method-intf>Home</method-intf>
<method-name>*</method-name>
</method>
<method>
<ejb-name>SdrFA</ejb-name>
<method-intf>Remote</method-intf>
<method-name>*</method-name>
</method>
</transaction-isolation>
The entity EJB is used by a servlet that uses JTA to establish a transaction that
the EJB methods should share ("Required" transaction attribute). The servlet is
as follows:
// Establish a transaction
UserTransaction trn =
(UserTransaction) ctx.lookup("java:comp/UserTransaction");
trn.begin();
trn.setTransactionTimeout(20);
// Get the EJB
SdrFA fFA = home.findByPrimaryKey( fFAPK );
// Update an attribute
fFA.setSomeAtt("someData");
// Sleep to control concurrency
Thread.currentThread().sleep(t * 1000);
// commit
trn.commit();
I expected this setup to prevent concurrent updates and even accesses to the same
DB table row, but this is not the case: when I invoke the servlet from a session
and then invoke it again from another session while the first one is sleeping,
the second one completes all right and is visible in the DB before the first one
commits.
Just in case TRANSACTION_SERIALIZABLE is not supported after all, I tried TRANSACTION_REPEATABLE_READ
instead whith the same results.
Is there something I'm missing, or any error in my setup?
Thanks for any suggestion,
Pere TorrodellasHi Pere,
AFAIR delay-updates-until-end-of-tx is set to True by default, so the
actual update is not issued untill TX is commited. I'd try setting it to
false and running the test again.
Here are some documentation references:
http://e-docs.bea.com/wls/docs61/ejb/EJB_environment.html#1048164
http://e-docs.bea.com/wls/docs61/ConsoleHelp/wls_ejb_jar_dtd.html
Regards,
Slava Imeshev
"Pere Torrodellas" <[email protected]> wrote in message
news:[email protected]...
>
I'm trying to use TRANSACTION_SERIALIZABLE isolation level in my EJB testapplication
with no success so far.
The environment is Windows NT, WebLogic 6.1, Informix DB (which, accordingto
its documentation, supports TRANSACTION_SERIALIZABLE), and a Tx DataSource on
a JDBC pool.
I have an CMP Entity EJB with the following definitions:
<container-transaction>
<method>
<ejb-name>SdrFA</ejb-name>
<method-name>*</method-name>
</method>
<trans-attribute>Required</trans-attribute>
</container-transaction>
<transaction-isolation>
<isolation-level>TRANSACTION_SERIALIZABLE</isolation-level>
<method>
<ejb-name>SdrFA</ejb-name>
<method-intf>Home</method-intf>
<method-name>*</method-name>
</method>
<method>
<ejb-name>SdrFA</ejb-name>
<method-intf>Remote</method-intf>
<method-name>*</method-name>
</method>
</transaction-isolation>
The entity EJB is used by a servlet that uses JTA to establish atransaction that
the EJB methods should share ("Required" transaction attribute). Theservlet is
as follows:
// Establish a transaction
UserTransaction trn =
(UserTransaction) ctx.lookup("java:comp/UserTransaction");
trn.begin();
trn.setTransactionTimeout(20);
// Get the EJB
SdrFA fFA = home.findByPrimaryKey( fFAPK );
// Update an attribute
fFA.setSomeAtt("someData");
// Sleep to control concurrency
Thread.currentThread().sleep(t * 1000);
// commit
trn.commit();
I expected this setup to prevent concurrent updates and even accesses tothe same
DB table row, but this is not the case: when I invoke the servlet from asession
and then invoke it again from another session while the first one issleeping,
the second one completes all right and is visible in the DB before thefirst one
commits.
Just in case TRANSACTION_SERIALIZABLE is not supported after all, I triedTRANSACTION_REPEATABLE_READ
instead whith the same results.
Is there something I'm missing, or any error in my setup?
Thanks for any suggestion,
Pere Torrodellas -
Z/os db2 (type 2) transaction isolation from rr to cs, general questions
Let me preface this by saying I'm pretty uninformed when it comes to database transaction isolation and what it really means to my application. I've done some homework on the differences between the read committed (cs) and repeatable read (rs) but still a little fuzzy.
App stats: Mainframe z/os db2 v8 (type 2 driver), WAS 6.0.x.x The app runs with about 80000 concurrent users (using about 150-200 JDBC connections in the pool).
I found this which held some good information: http://forum.java.sun.com/thread.jspa?forumID=48&threadID=586570 but it leaves me with some questions still.
Our Mainframe dba is saying he sees a lot of locking (not dead locks, just locks) and it is eating up the MIPS. He told us to set our transaction isolation level to cs to reduce the locking db2 does. But I don't know enough about this to make a good decision. The general consenus I've gotten from various forums (spring, hibernate) is that using CS will cause more problems than it will fix.
The only sql error I see in our logs is due to an insert or update to a FK being invalid. I suppose this could cause some locking problems but would this cause deadlocks?
If anyone can provide some links to explain this, I'd be really appreciative. Or if you have any first hand knowledge -- even better.
Thanks for your time.I am also not an expert and haven't used DB/2 on z/OS but am using it on OS/400. I think your DBA is confused.
From what I have experienced setting commit control to CS causes more locking than RS. From what I can determine (which has been through trial and error so it may not be totally accurate) CS causes the database to exclusive lock all records in the cursor while RS will use shared locks. I do know from painful experience that if you set all your transactions to CS you will experience frequent update problems due to record locks. We had to go through and set everything to RS and, once we did, our concurrency problems were nearly eliminated. There are some instances that you have to use *CS, however, such as when a stored procedure returns a cursor, but the compiler will tell you about this.
Another thing that doesn't make sense is locks are typically implemented as data structures in memory and do not require much if any processor time. I don't know the specifics of DB/2 implementation but Oracle uses simple semaphores, so I would assume IBM does, too.
Also, from my experience, there appears to be no way around DB/2 locking. Having come from an Oracle background I find the amount of locking DB/2 does totally frustrating. It's not as bad as SQL Server but can become problematic at times. That is just my $.02 anyway.
Maybe you are looking for
-
DBMS_METADATA.GET_DDL inside the pl/sql procedure
We have a requirement to drop certain materialized view and need to recreate based on certain condition inside the pl/sql procedure.i am using the dbms_metadata to get the Mv ddls. var1 := 'SELECT DBMS_METADATA.GET_DDL('MATERIALIZED_VIEW,'MV_NAME','O
-
XML Forms Builder - Create XML in external System
Hi, Is it possible to create a XML file in a system external to Portal (the DataModel is the same) and after uploading it to the Portal and obtain the same behavior (rendering) of a XML created in Portal by the form generated by XML Forms Builder? I'
-
No matter what I do, I cannot change the itunes background color from black, and I just hate it. Yes, I've changed the "grid" view to light, and to dark, and nothing changes on my iMac. Can this be changed somehow? I find it unreadable and it caus
-
Using swing elements in JSP pages
I am developing a web application using jsp pages. In this application i want to display some information in a seperate window. For this i created a class which extends JFrame. This class makes also use of the singleton principle. In the jsp i use th
-
hi all i am looking for answers for the followings 1) what is the bussiness object for purchase order ? 2) how can we get the list of idoc contains an errors ? 3)use of control form in function module ? thanks