Read committed isolation level must not produce nonrepeatable read
Hi,
I am sql server DBA. But i am trying to improve myself in oracle too.
I read isolation levels in oracle. And it says, In read committed isolation level , oracle guarantees the result set that contains committed records at the beginning of reading operation.
İf it is guaranteed , how does nonrepeatable read can occur? It must not occur then.
I think , I misunderstood something .
can you explain me?
Thanks
>
I read isolation levels in oracle. And it says, In read committed isolation level , oracle guarantees the result set that contains committed records at the beginning of reading operation.
İf it is guaranteed , how does nonrepeatable read can occur? It must not occur then.
>
See the 'Multiversion Concurrency Control' section in the database concepts doc. It discusses this and has a simple diagram (can't post it) that shows it.
http://docs.oracle.com/cd/B28359_01/server.111/b28318/consist.htm
>
As a query enters the execution stage, the current system change number (SCN) is determined. In Figure 13-1, this system change number is 10023. As data blocks are read on behalf of the query, only blocks written with the observed SCN are used. Blocks with changed data (more recent SCNs) are reconstructed from data in the rollback segments, and the reconstructed data is returned for the query. Therefore, each query returns all committed data with respect to the SCN recorded at the time that query execution began. Changes of other transactions that occur during a query's execution are not observed, guaranteeing that consistent data is returned for each query.
Statement-Level Read Consistency
Oracle Database always enforces statement-level read consistency. This guarantees that all the data returned by a single query comes from a single point in time—the time that the query began. Therefore, a query never sees dirty data or any of the changes made by transactions that commit during query execution. As query execution proceeds, only data committed before the query began is visible to the query. The query does not see changes committed after statement execution begins.
>
The first sentence is the key:
>
As a query enters the execution stage, the current system change number (SCN) is determined.
>
Oracle will only query data AS OF that SCN that was determined.
If you now rerun the query Oracle repeats the process: it determines the SCN again which could be newer if other users have committed changes.
That second execution of the query may find that some rows have been modified or even deleted and that new rows have been inserted: nonrepeatable read.
If you use the SERIALIZABLE isolation level then that second query will use the SCN that was determined at the very START of the transaction. For the simple example above it means the second query would use the SAME SCN that the first query used: so the same data would be returned.
Table 13-2 in that doc (a few pages down) lists the isolation levels
>
Read committed
This is the default transaction isolation level. Each query executed by a transaction sees only data that was committed before the query (not the transaction) began. An Oracle Database query never reads dirty (uncommitted) data.
Because Oracle Database does not prevent other transactions from modifying the data read by a query, that data can be changed by other transactions between two executions of the query. Thus, a transaction that runs a given query twice can experience both nonrepeatable read and phantoms.
Similar Messages
-
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 -
Transaction Isolation Level to Read UnCommited in Non OLTP Database
HI,
We are having a database which for NOT OLTP process. That is OLAP DB. Operation on that DB is only Select and (Incremental Insert - FOR DWH ) not Update/Delete and we are performing ROLAP operations in that DB.
By Default SQL Server DB isolation Level is READ COMMITTED.AS Our DB IS OLAP SQL Server DB we need to change the isolation level toRead Uncommited. We google it down but We can achive in
Transaction level only by SET isoaltion Level TO Read UNCOMMITED
or ALLOW_SNAPSHOT_ISOLATION ON or READ_COMMITTED_SNAPSHOT
Is there any other way if we can Change the Database isolation level to READ uncommitedfor Entire Database?, insteads of achiving in Transaction Level or With out enabling SET ALLOW_SNAPSHOT_ISOLATION ON or READ_COMMITTED_SNAPSHOT
Please use Marked as Answer if my post solved your problem and use Vote As Helpful if a post was useful.
Please use Marked as Answer if my post solved your problem and use Vote As Helpful if a post was useful.Hi,
My first question would be why do you want to change Isolation level to read uncommitted, are you aware about the repercussions you will get dirty data, a wrong data.
Isolation level is basically associated with the connection so is define in connection.
>> Transaction level only by SET isoaltion Level TO Read UNCOMMITED or ALLOW_SNAPSHOT_ISOLATION ON or READ_COMMITTED_SNAPSHOT
Be cautious Read UNCOMMITED and Snapshot isolation level are not same.The former is pessimistic Isolation level and later is Optimistic.Snapshot isolation levels are totally different from read uncommitted as snapshot Isolation level
uses row versioning.I guess you wont require snapshot isolation level in O:AP DB.
Please read below blog about setting Isolation level Server wide
http://blogs.msdn.com/b/ialonso/archive/2012/11/26/how-to-set-the-default-transaction-isolation-level-server-wide.aspx
Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers
My TechNet Wiki Articles -
Isolation level: repeatable read vs read stability.
I was going through the following link [http://www.developer.com/print.php/3706251] about database isolation levels. There was a statement:
In Read Stability, only rows that are retrieved or modified are locked, whereas in Repeatable Read, all rows that are being referenced are locked.
What is meant by "all rows that are being referenced".
According to my understanding in case of repeatable read, the table is locked. Is this understanding correct?
Edited by: user476453 on Oct 29, 2010 2:03 AMThis article is referencing DB2 isolation levels and not Oracle ones: isolation levels are standardized in SQL but practically they can be very different from one database to another. For Oracle please refer to http://download.oracle.com/docs/cd/E11882_01/server.112/e16508/consist.htm#CNCPT621.
Your DB2 question should be posted on DB2 forum and not on an Oracle forum. -
Isolation level in cftransaction
Hi all,
We have been using cftransaction on our transaction process page where we need to do multiple insert queries to save transaction data. If there is no error, we commit the transaction. Once in a while though, we get the error message "Transaction was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction." We are on SQL Server 2005.
What I understand from that error message is that there are multiple transactions trying to access the same tables at the same time. Implicitly, one transaction has locked the tables while it is inserting data, and other transactions are not able to access them.
Now I don't fully understand cftransaction beyond its commit / rollback functionality. I never quite understood the isolationLevel attribute of cftransaction. I have read a number of descriptions, but the terms dirty read, phantom data, nonrepeatable reads are still confusing to me. What I do understand is that unless we specify isolationLevel = serializable in a transaction, it is not locking the tables it is accessing. In our use of cftransaction, we don't specify the isolationLevel attribute ( I believe the default is read committed .)
So here are my questions:
1. If we don't specify any isolation level, why are we getting deadlock transactions?
2. If we do want to lock the tables using isolationLevel = serializable, does a concurrent transaction trying to use the same tables automatically get deadlocked? Or is there a mechanism to specify timeout ala cflock timeout attribute?
I'd appreciate someone clearing up my understanding of cftransaction. Thanks!I know this is an old post, but I have had the same questions recently and based on my recent findings, have attempted to answer your questions below for anyone in the future:
1. If we don't specify any isolation level, why are we getting deadlock transactions?
The reason this could be happening is because the cftransaction tag will use the default isolation level of your database. For SQL Server this is usually Read Committed. However, it is important to note that, "Choosing a transaction isolation level does not affect the locks acquired to protect data modifications. A transaction always gets an exclusive lock on any data it modifies, and holds that lock until the transaction completes, regardless of the isolation level set for that transaction. For read operations, transaction isolation levels primarily define the level of protection from the effects of modifications made by other transactions." This quote is taken directly from the MS SQL Server site. I understand this by stating that if you are doing a read, the isolation level determines the quality and/or quantity of the data returned from the read. If you are doing data modifications, the transaction will always get an exclusive lock on any data being modified. The cftransaction tag can control when it is committed based on its placement, but does not control the data modification isolation levels.
2. If we do want to lock the tables using isolationLevel = serializable, does a concurrent transaction trying to use the same tables automatically get deadlocked? Or is there a mechanism to specify timeout ala cflock timeout attribute?
The first question helps to answer this second one. The isolation level attribute (serializable or other) applies to the level of protection read operations will receive from other transactions' modifications. It does not effect on the locks aquired to protect data modifications. This is controlled by the database itself. The cflock tag only applies to CF meaning it ensures single thread access to that code (e.g. application, session or server variables), not to the database.
I hope this helps someone in the future and that I have not misstated anything. If anyone can provide better clarification please do so. -
Isolation Level vs. Locking
Hello,
I am still wrestlling a bit with the issues involved in setting an isolation
level. I am using WL 5.1, Oracle, and CMP.
I do now understand the issues involved between Oracle's
SERIALIZABLE and READ-COMMITTED isolation levels, etc.
But I also note that weblogic uses a pessimistic locking
approach for serializing access to entity ejb's. Doesn't this
locking supercede anything but an isolation level of
SERIALIZABLE? What happens with an isolation level
of READ-COMMITTED, even though the access to an
entity within any transaction will be serialized anyway?
Are there issues related to persistence issues outside of
ejb's, such as using JMS persistent messages within the
same system (same connection pool, etc.).
Also, I note that the ejb 2.0 spec in weblogic will allow
a more optimistic locking model. In this case, how will
multiple commits behave, will they behave according
to the isolation level chosen (READ-COMMITTED
or SERIALIZABLE?).
It's all confusing. What is the point, in ejb 1.1, for allowing
the bean developer to specify an isolation level, if all
access to entities will be done with exclusive locks?
What happens with multiple result finder methods? Does
this place exclusive locks on each entity found, within
a transaction?
Should I spend more time worrying about locking
models or isolation levels.
Am I just going around in circles?
Jason
Jason Rosenberg
SquareTrade
(remove 'nospam' from my return address)Well, for now, I am designing for Oracle. What do you mean
by hazy?
Kirk Wylie <[email protected]> wrote in message news:[email protected]...
Probably not something you can count on guaranteeing no blocking. The
database could very well block here, particularly if your'e using
anything other than Oracle on the back-end, and Oracle can be a bit,
ahem, hazy in its acceptance of its own semantics here.
Kirk Wylie
Jason Rosenberg wrote:
Well, if the database table is set up to use READ-COMMITTED,
then it shouldn't block on the database, correct?
Jason
Cameron Purdy <[email protected]> wrote in message news:[email protected]...
... which means it could block on the database, correct?
Cameron Purdy
"Rob Woollen" <[email protected]> wrote in message
news:[email protected]...
A finder will never block on a container lock. For instance, imagine
that primary keys 3 and 4 are currently participating in a transaction
and are locked in server A. If a finder is called in server A which
returns these keys, the finder will run independently of the EJB server
locks. (Of course the database isolation will still apply.)
-- Rob
Jason Rosenberg wrote:
Ah, clustering saves the day!
I'm wondering though, since we don't have control over which
server in a cluster a given ejb may run on at any given time,
the concurrent behavior may be different to control. Some
times you can have concurrent access based on
READ-COMMITTED on the db level, and some times weblogic
will force a SERIALIZABLE behavior if 2 conflicting
ejb's get instantiated in the same container.
This is what I want. I would like complex finder methods
to be able to return a collection of primary keys over a
table, based on a READ-COMMITTED basis. This
needs to happen often, and shouldn't block (it's ok
if it misses out on uncommitted data in process, or
if it returns keys that may be in the process of being
deleted). But I don't ever want it to block because
another component has uncomitted changes in process.
Ideas? Wait for ejb2.0?
Jason
Rob Woollen <[email protected]> wrote in message
news:[email protected]...
It matters if you are in a cluster, or if othercomponents/applications
are accessing the same data.
It will also matter if your db does not have row-level locking.
-- Rob
Jason Rosenberg wrote:
I've excerpted below some of the text from the weblogic
documentation.
What this says to me is that, indeed, if an ejb entity is in anywayinvolved
in a transaction, all other transactions will be blocked frominstantiating
and using the bean instance until the transaction is over.
This is a de-facto SERIALIZABLE isolation level, is it not, with allthe
plusses and minuses. The plus is that data integrity is maintained,the
minus is that concurrent access is negatively effected.
What am I missing. Given this mechanism, what difference does it
make whether I use of a transaction isolation level ofREAD-COMMITTED
or SERIALIZABLE?
It looks like the story does change for ejb2.0.....
From the weblogic online documentation at:
http://www.weblogic.com/docs51/classdocs/API_ejb/EJB_environment.html#108796
7
Locking Model for Entity EJBs
The EJB 1.1 container in WebLogic Server Version 5.1 uses apessimistic locking mechanism for entity EJB instances. As clients
enlist an EJB or EJB method in a transaction, WebLogic Server placesan exclusive lock on the EJB instance or method for the
duration of the transaction. Other clients requesting the same EJBor method block until the current transaction completes.
This method of locking provides reliable access to EJB data, andavoids unnecessary calls to ejbLoad() to refresh the EJB
instance's
persistent fields. However, in certain circumstances pessimistic
locking may not provide the best model for concurrent access to
the
EJB's data. Once a client has locked an EJB instance, other clients
are blocked from the EJB's data even if they intend only to
read
the persistent fields.
To improve concurrent access for entity EJB's, the WebLogic Server
EJB 2.0 container enables you to defer locking services to
the
underlying database. In most cases, the underlying data store can
provide finer granularity for locking EJB data, and improve
throughput for concurrent access to the bean's data. See EJB 2.0 forBEA WebLogic Server Overview for more information.
Cameron Purdy <[email protected]> wrote in message
news:[email protected]...
I believe the "locking" refers to an internal WL implementationthat
prevents multiple threads from accessing an EJB instance.
Cameron Purdy, LiveWater
"Jason Rosenberg" <[email protected]> wrote in message
news:[email protected]...
Hello,
I am still wrestlling a bit with the issues involved in setting
an
isolation
level. I am using WL 5.1, Oracle, and CMP.
I do now understand the issues involved between Oracle's
SERIALIZABLE and READ-COMMITTED isolation levels, etc.
But I also note that weblogic uses a pessimistic locking
approach for serializing access to entity ejb's. Doesn't this
locking supercede anything but an isolation level of
SERIALIZABLE? What happens with an isolation level
of READ-COMMITTED, even though the access to an
entity within any transaction will be serialized anyway?
Are there issues related to persistence issues outside of
ejb's, such as using JMS persistent messages within the
same system (same connection pool, etc.).
Also, I note that the ejb 2.0 spec in weblogic will allow
a more optimistic locking model. In this case, how will
multiple commits behave, will they behave according
to the isolation level chosen (READ-COMMITTED
or SERIALIZABLE?).
It's all confusing. What is the point, in ejb 1.1, for allowing
the bean developer to specify an isolation level, if all
access to entities will be done with exclusive locks?
What happens with multiple result finder methods? Does
this place exclusive locks on each entity found, within
a transaction?
Should I spend more time worrying about locking
models or isolation levels.
Am I just going around in circles?
Jason
Jason Rosenberg
SquareTrade
(remove 'nospam' from my return address)
Kirk Wylie | mailto:[email protected] | http://www.radik.com -
Hi ,
I was using the DDConvertor supplied with WL51 to convert my old
DeploymentDescriptor.txt to the new XML format.
I have noticed that the Isolation Level did not pass to the new format.
My entity bean is not container managed and the Isolation level is
READ_COMMITED .
No weblogic-cmp-rdbms-jar.xml File was generated.
Attached are the files.
Could you please tell me where can I specify the Isolation Level if I have
no rdbms file ?
thanks
Amit Sivan
[DeploymentDescriptor.txt]
[weblogic-ejb-jar.xml]weblogic-ejb-jar.xml
amit sivan wrote:
Hi ,
I was using the DDConvertor supplied with WL51 to convert my old
DeploymentDescriptor.txt to the new XML format.
I have noticed that the Isolation Level did not pass to the new format.
My entity bean is not container managed and the Isolation level is
READ_COMMITED .
No weblogic-cmp-rdbms-jar.xml File was generated.
Attached are the files.
Could you please tell me where can I specify the Isolation Level if I have
no rdbms file ?
thanks
Amit Sivan
; Copyright (c) 1998-1999 by BEA WebXpress. All Rights Reserved.
(EntityDescriptor
beanHomeName pay2card.OnlineHomeEntity
enterpriseBeanClassName pay2card.beans.online.entity.OnlineEntityBean
homeInterfaceClassName pay2card.beans.online.entity.OnlineEntityHome
remoteInterfaceClassName pay2card.beans.online.entity.OnlineEntity
isReentrant false
(accessControlEntries
; DEFAULT [admin manager]
); end accessControlEntries
(controlDescriptors
(DEFAULT
isolationLevel TRANSACTION_READ_COMMITTED
transactionAttribute TX_REQUIRED
runAsMode CLIENT_IDENTITY
; runAsIdentity admin
); end DEFAULT
); end controlDescriptors
(environmentProperties
; homeClassName
; ejbObjectClassName
maxBeansInFreePool 20
maxBeansInCache 1000
idleTimeoutSeconds 60
; isModifiedMethodName isModified
); end environmentProperties
; Entity EJBean-specific properties:
primaryKeyClassName pay2card.beans.online.entity.OnlinePK
; end entity EJBean-specific properties.
); end EntityDescriptor
<?xml version="1.0"?>
<!DOCTYPE weblogic-ejb-jar PUBLIC '-//BEA Systems, Inc.//DTD WebLogic 5.1.0 EJB//EN' 'http://www.bea.com/servers/wls510/dtd/weblogic-ejb-jar.dtd'>
<weblogic-ejb-jar>
<weblogic-enterprise-bean>
<ejb-name>pay2card.OnlineHomeEntity</ejb-name>
<caching-descriptor>
<max-beans-in-free-pool>20</max-beans-in-free-pool>
<max-beans-in-cache>1000</max-beans-in-cache>
<idle-timeout-seconds>60</idle-timeout-seconds>
</caching-descriptor>
<persistence-descriptor>
<delay-updates-until-end-of-tx>false</delay-updates-until-end-of-tx>
</persistence-descriptor>
<jndi-name>pay2card.OnlineHomeEntity</jndi-name>
</weblogic-enterprise-bean>
</weblogic-ejb-jar> -
hi,
I have enable snapshot isolation level, in my database all queries execute in read commited isolation only one big transaction uses snapshot isolation.
q1)i wanted to know if snapshot silation transaction is not running but database is enable for snapshot ,then will the normal
queries using read commited will create versions or not.
yours sincerley.Enabling snapshot isolation level on DB level does not change behavior of queries in any other isolation levels. In that option you are eliminating all blocking even between writers (assuming they do not update
the same rows) although it could lead to 3960 errors (data has been modified by other sessions).
Best Regards,Uri Dimant SQL Server MVP,
http://sqlblog.com/blogs/uri_dimant/
MS SQL optimization: MS SQL Development and Optimization
MS SQL Consulting:
Large scale of database and data cleansing
Remote DBA Services:
Improves MS SQL Database Performance
SQL Server Integration Services:
Business Intelligence -
There appears to be an error when trying to view Health Reports from Central Administration. A simple fix within a SharePoint Stored Procedure fixes the problem. I get the error message "You can only specify the READPAST lock in the READ COMMITTED or
REPEATABLE READ isolation levels." when just trying to click "View Health Reports" --> Go in CA.
I have found the same problem in some blog posts which leads me to believe this is a bug:
Problems Viewing Health Reports in SharePoint 2013
From the blog post "I managed to work around it by altering the
proc_GetSlowestPages stored procedure and commenting out the
WITH (READPAST) line. "
This also worked for me. It would be great if a fix could be released for this problem as it seems to cause other problems as well (site analytics freezes).Hi Dennis
Hope you had found the hotfix and installed it.
For the benefit of others who visit this thread SharePoint Server 2013 Client Components SDK hotfix package addresses this issue.http://support.microsoft.com/kb/2849962
Regards
Sriram.V -
You can only specify the READPAST lock in the READ COMMITTED or REPEATABLE READ isolation levels
Hi, I have a piece of code that works fine in SSMS as T-SQL. When I put the T-Sql inside a SP, I get the error :
You can only specify the READPAST lock in the READ COMMITTED or REPEATABLE READ isolation levels
The script starts is as follows (only select)
SET NOCOUNT ON
Set Transaction Isolation Level Read Committed
Set Deadlock_Priority Low
Select......
From MyTable WITH (NOLOCK)
GROUP BY .....
Order BY ....
works fine as I said in SSMS as T-SQL but the SP generates the following
Msg 650, Level 16, State 1, Procedure usp_TotalMessages, Line 15
You can only specify the READPAST lock in the READ COMMITTED or REPEATABLE READ isolation levels.
By the way, when it says line 15, from where we should start counting, is it from The USE DB statement which includes comments as well as Set ANSI....or should we start counting from the Alter PRocedure statement
Thanks in advanceSet Transaction Isolation Level Read Committed
Set Deadlock_Priority Low
Select......
From MyTable WITH (NOLOCK)
GROUP BY .....
Order BY ....
First you define transactionlevel = "Read Committed", then you use a query hint "NOLOCK" which is equivalent to "Read Uncommitted"; so what do you want now, committed or uncommitted, you have to decide.
Olaf Helper
[ Blog] [ Xing] [ MVP] -
Is isolation level setting(Dirtry Read Options) working fine for DB2?
Hello Gurus,
We are building obiee reports on DB2 OLTP database. As per my understanding if we select the Isolation level as "Dirty Read" it should not lock the tables but. In our case it is locking the tables and causing others(application Users) not to update the data. Please let us know if you have faced the same issue or any solution. Our production migration is stopped because of this issue.
Thanks,
AnilJust a follow up, I think the isolation level is perhaps being set to REPEATABLE_READ,
since that is what seems to be happening. The value from the first read is maintained
through subsequent reads in the same transaction.
lance
"Lance" <[email protected]> wrote:
>
>I have a Message Driven Bean (MDB) that is container managed, and its
>transaction
>isolation is set to TRANSACTION_READ_COMMITTED in weblogic-ejb-jar.xml
>and that
>seems to work fine. If I look at an entity bean in onMessage which is
>updated/commited
>outside the transaction I can see the updates no problem.
>
>Now the problem is this.. inside the onMessage method, the MDB creates
>a new
>instance of a class. This class starts up its own UserTransaction (using
>(UserTransaction)new
>InitialContext().lookup("javax.transaction.UserTransaction")) and goes
>into a
>loop working away. Inside the loop it is inspecting a value on an entity
>bean.
> The classs never sees any updates to this bean which are made outside
>this new
>UserTransaction.
>
>It looks to me that the UserTransaction that the class is getting has
>a different
>isolation level (serialized?). Is there a way to set the isolation level
>for
>a UserTransaction?
>
>Any help would be great!
>
>lance
-
Isolation Level of SQL Server when committing statements
Dear All,
Can someone please tell me whether Read Committed and
Auto commit means the same thing in transaction Isolation level?
I assume if SQL default is Auto Commit then it commits all transactions whether we use
"Commit Transaction' cmd or not.
Thank-you
SQL75We write T-SQL in both right?
Sorry didnt understand what you meant by that.
Isolation Level and Transaction Management are two different aspects of T-SQL.
The former talks about level up to which a transaction can proceed without intervention from other parallel
transactions. In Read Commited no other transaction will be able to read data that is in use by the current transaction unless its done ie commited/rolled back. But it may introduce additional data that may fall in the range of data which first transaction
is currently in hold causing phantom reads
The transaction management explains whether one needs to explicitly specify start and end of transaction
or whether system will implicitly dtermine the start and end of the transaction.
Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs -
Using Berkeley DB version 4.5.
DB environment is opened with following flags:
DB_CREATE, DB_RECOVER, DB_INIT_LOCK, DB_INIT_LOG, DB_INIT_TXN, DB_INIT_MPOOL, DB_PRIVATE and DB_THREAD.
My requirement: I need to use the cursor to iterate over all objects in a database which is only for ready only operation. However, it should allow other threads to update the same database in a transaction (w/ less wait time due to lock held by the read cursor) .
From the API referennce, Cursor isolation level can be controlled by setting the flag in DB->cursor() .
I can't use DB_READ_UNCOMMITTED as it returns dirty data. It looks like DB_TXN_SNAPSHOT is the perfect for cursor read as it doesn't take the read lock so other threads can continue with the write operation but then according to the manual this will affect peformance of write operation (as it has to update multiple version of the object in cache).
So, it looks like my next option is to use DB_READ_COMMITTED flag but I am not sure it affect with or without transactionId passed to DB->cursor().
Can you please suggest the appropriate flag to set in DB->cursor() for read-cursor (which satisfies my requirement) and what is the affect of passing txnId (and if txnId is not passed) ?
when Cursor is iterated at what point read lock is acquired and released?
Thanks in advance for your help,
RajHi Raj,
So, it looks like my next option is to use DB_READ_COMMITTED flag but I am not sure it affect with or without transactionId passed to DB->cursor().
Can you please suggest the appropriate flag to set in DB->cursor() for read-cursor (which satisfies my requirement) and what is the affect of passing txnId (and if txnId is not passed) ?
when Cursor is iterated at what point read lock is acquired and released?Degree 2 isolation, committed reads, means that the cursor will only read data that is committed (never dirty data, non-committed data); data will never change so long as it is addressed by the cursor, but the data may change before the reading cursor is closed. The read lock on a page is acquired when the cursor needs to move onto that page to read from it a record; the read lock is released as soon as the cursor moves away from that page.
The cursor has the same behavior whether a transaction id (txnId) is specified or not.
Please review the following documentation sections for more information:
- Isolation and Committed Reads in Getting Started with Berkeley DB Transaction Processing
- Degrees of isolation in Berkeley DB Programmer's Reference Guide
Regards,
Andrei -
Setting the Isolation Level to Read Uncommitted
Hello All,
We are using BO XI r3 and SQL Server 2008. I would like to change the isolation level of the connection to read uncommitted. There are 2 options that i could by Googling..
1. Making changes in the SBO file... this didnt work
2. Making changes in the connectinit... even this didnt work
i am not sure if there is anything else to done... but i tried quering a table with a lock, the report got stuck so i am guessing that the settings didnt workHi
this is the only method for changing the transaction isolation level.
Locate the path to your odbc.sbo file
Click the connection in UDT and when server responds Click the Details button
scroll down to the sbo line
That is the file location of your sbo file (this will be the same on client and server)
This change needs to be done, for client and servers both
The isolation can only be set for the global connection. Not per universe.
Locate the file and make a backup before making any changes
Find the Tag
<DataBase Active="Yes" Name="MS SQL Server 2008">
Below that tag should be a "Force SQLExecute" Parameter
Like This
<Parameter Name="Force SQLExecute">Procedures</Parameter>
ADD this line
<Parameter Name="Transaction Isolation Level">READ_UNCOMMITTED</Parameter>
Save the odbc.sbo
After client and server are changed
Restart SIA
Run the webi document again.
Locations of the sbo file:
R2: <Installation Directory>:\Program Files\Business Objects\BusinessObjects Enterprise 11.5\win32_x86\dataAccess\connectionServer\rdbms
R3: <Installation Directory>:\Program Files\Business Objects\BusinessObjects Enterprise 12.0\win32_x86\dataAccess\connectionServer\rdbms
BI4: <Installation Directory>:\Program Files (x86)\SAP BusinessObjects\SAP BusinessObjects Enterprise XI 4.0\dataAccess\connectionServer\rdbms
To make these changes effect, you have to restart ‘CMS server’, ‘the Connection Servers’, ‘Webi Report Server’ from ‘Central Configuration Manager’ (CCM).
Information is available in the Data Access guide
Jacqueline -
Setting Transaction isolation level when I'm not in an EJB
I have a Message Driven Bean (MDB) that is container managed, and its transaction
isolation is set to TRANSACTION_READ_COMMITTED in weblogic-ejb-jar.xml and that
seems to work fine. If I look at an entity bean in onMessage which is updated/commited
outside the transaction I can see the updates no problem.
Now the problem is this.. inside the onMessage method, the MDB creates a new
instance of a class. This class starts up its own UserTransaction (using (UserTransaction)new
InitialContext().lookup("javax.transaction.UserTransaction")) and goes into a
loop working away. Inside the loop it is inspecting a value on an entity bean.
The classs never sees any updates to this bean which are made outside this new
UserTransaction.
It looks to me that the UserTransaction that the class is getting has a different
isolation level (serialized?). Is there a way to set the isolation level for
a UserTransaction?
Any help would be great!
lance
Just a follow up, I think the isolation level is perhaps being set to REPEATABLE_READ,
since that is what seems to be happening. The value from the first read is maintained
through subsequent reads in the same transaction.
lance
"Lance" <[email protected]> wrote:
>
>I have a Message Driven Bean (MDB) that is container managed, and its
>transaction
>isolation is set to TRANSACTION_READ_COMMITTED in weblogic-ejb-jar.xml
>and that
>seems to work fine. If I look at an entity bean in onMessage which is
>updated/commited
>outside the transaction I can see the updates no problem.
>
>Now the problem is this.. inside the onMessage method, the MDB creates
>a new
>instance of a class. This class starts up its own UserTransaction (using
>(UserTransaction)new
>InitialContext().lookup("javax.transaction.UserTransaction")) and goes
>into a
>loop working away. Inside the loop it is inspecting a value on an entity
>bean.
> The classs never sees any updates to this bean which are made outside
>this new
>UserTransaction.
>
>It looks to me that the UserTransaction that the class is getting has
>a different
>isolation level (serialized?). Is there a way to set the isolation level
>for
>a UserTransaction?
>
>Any help would be great!
>
>lance
Maybe you are looking for
-
Install service pack 2 in sharepoint medium form
Hi i have a sharepoint medium form in production environment and i want to apply service pack 2 form has : 2 Application servers 2 Web front end servers 2 Index servers 1 Database server Servers Operating System Configuration Database version Ser
-
How can I remove a device from my network, an iPod
how do I remove a device that is signed into my network? I want to remove my child's iPod when I'm not home so they don't have free access to the internet through it.
-
After installing several updates, the system is unstable
Hello, I tried to install my mac mini server several times, all works fine, but after installing the updates from Apple update service, the VPN, Workgroup manager makes problems. In the last case I installed the last great update for the snow leopard
-
Desktop background displays path in middle of image
Regardless of the background image I choose, the path displays in large white text across the image. How can this be fixed?
-
Install opstart system on exernal drive
I'm using a G4 and 10.3.9, a Maxtor and a VST external drive. I want to startup from one of my external drives. After startup from the installCD 10.3, Disk Utility shows that my external drives are not suitable for installing 10.3. All drives are HFS