Re: Question: database commit



www.guanfenglin.com wrote on 06.02.2006 21:47:
Hello Guys,

I have a database commit question here:
suppose I have a transaction, inside the transaction i have 2 queries
to run then commit. The 1st query is to update the database, and the
second query is to select from the database which relates to the 1st
query, without commiting the first query to the database, will the 2nd
query select the correct information?



As long as the update and the select are run in the same transaction, then yes the select will (and has to if the DBMS conforms to the ACID principles) the updated value. For the JDBC drivers I know, this means that both statements have to be executed using the same Connection object, otherwise they'll never be in the same transaction.

Thomas
.



Relevant Pages

  • Re: Transaction Isolation Level
    ... This means that while I initiate a transaction selecting all new orders it ... is possible for others to add other new orders to the database which I will ... My query is executed on a SQL server 2005. ... the isolation level you should use is snapshot isolation. ...
    (comp.databases.ms-sqlserver)
  • Re: Driver AutoCommit issue
    ... I am using the container managed transaction and I expect the container to handle that for me. ... Is there different driver class that i have to use in the connection pool configuration. ... Why I am saying the DML always gets committed is when I step thought the code I can see the updated data in the database immediately after the callable statement is executed Even before the EJB method that invoked the call is completed. ... I set the auto commit to false on connection as soon as I get the connection from the datasoruce. ...
    (microsoft.public.sqlserver.jdbcdriver)
  • Re: commit
    ... I am using SQLite, and I want to select the maxfrom a certain ... gives an error telling that the database is locked if in that moment ... allowing an update until the "transaction" finishes. ... Only then does process A commit its transaction and the rowA becomes ...
    (perl.beginners)
  • Re: buffer cache and Rollback
    ... a query that reads data that has been updated ... specific RBS specified in the transaction slot of the updating transaction, ... A rollback/undo block is just another block, if it's in the buffer cache ... updated blocks or time it takes to issue the commit, ...
    (comp.databases.oracle.server)
  • Re: Append query is slow! Would VB be faster?
    ... I checked the query property adn, from tne beginning, the Use Transaction ... If you are just executing the query from the database window, ... You may get substantial performance benefits by setting the UseTransaction ...
    (microsoft.public.access.modulesdaovba)