473,395 Members | 1,502 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

transaction and open table

Hi,

I have few db write and read to execute, so I use transaction.

Is that a problem or is that a regular way that I only use transaction on
some cmds only, and other cmds I do not use trasaction, esp those read
actions, or even use another dbconnection to read?

BTW, what does "open table" menas? Is that table only be "open" when someone
read or write it. Once all user finish read or write the db table, the
table should be "closed", is that right?

Thanks a lot!
R L

Jun 24 '07 #1
2 2114
"Ryan Liu" <Ry********@yahoo.comwrote in message
news:el**************@TK2MSFTNGP04.phx.gbl...
I have few db write and read to execute, so I use transaction.

Is that a problem or is that a regular way that I only use transaction on
some cmds only, and other cmds I do not use trasaction, esp those read
actions, or even use another dbconnection to read?
It depends on what you are trying to accomplish. If the transaction is
properly isolated (which you control through the transaction isolation
level), then those commands that you execute outside of the transaction will
not see the changes that you have done inside the transaction until the
transaction is committed. This may or may not be what you want to happen.
Moreover, since the transaction will place locks on the database to
accomplish the isolation, depending on what you are doing you risk that the
database commands that you are executing outside of the transaction might
get blocked waiting for the transaction to finish. You certainly don't want
this to happen, because the blocked command would stop your program from
proceeding to complete the transaction, and therefore would never get
unblocked.

BTW, what does "open table" menas? Is that table only be "open" when
someone
read or write it. Once all user finish read or write the db table, the
table should be "closed", is that right?
If you are sending Sql commands to a database, then the tables are not
'open' or 'closed'. They simply get some locks placed upon them when they
are accessed inside a transaction, and the locks are removed when the
transaction completes. This is automatic, and you don't have to do anything
special for it to happen.

Jun 24 '07 #2

"Ryan Liu" <Ry********@yahoo.comwrote in message
news:el**************@TK2MSFTNGP04.phx.gbl...
Hi,

I have few db write and read to execute, so I use transaction.

Is that a problem or is that a regular way that I only use transaction on
some cmds only, and other cmds I do not use trasaction, esp those read
actions, or even use another dbconnection to read?
The only time you need to be in a transactional mode is when you are
updating, inserting or deleting records using a database table.
>
BTW, what does "open table" menas? Is that table only be "open" when
someone
read or write it. Once all user finish read or write the db table, the
table should be "closed", is that right?
Yes, once the access is completed, then the connection should be closed and
disposed, each time after the access.

http://www.sql-server-performance.co...ansactions.asp

You should use Google and look up the ADO.NET *Using* statement that
opens/closes/disposes things for you automatically.

Jun 24 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
by: noah | last post by:
Does PHP have a feature to associate Cookie sessions with a persistent database connection that will allow a single transaction across multiple HTTP requests? Here is how I imagine my process: I...
1
by: Avanish Pandey | last post by:
Hello All We have 3 differen services (in 3 different server) Service A,B,C . We want to implement distributed transaction when call methods of B and C from A. Is it possible? if yes then how? ...
3
by: Hardy Wang | last post by:
Hi all, I have an application, which requires several SQL activities, so I wrap them in a transaction: SqlConnection conn = new SqlConnection(connectionString); conn.Open(); SqlTransaction tran...
6
by: Crash | last post by:
C# VS 2003 ..Net Framework V1.1 SP1 SQL Server 2000 SP3 Enterprise Library June 2005 I'm working with some code {not of my creation} that performs the following sequence of actions: - Open...
3
by: joshsackett | last post by:
I am redesigning an application that distributes heldesk tickets to our 50 engineers automatically. When the engineer logs into their window a stored procedure executes that searches through all...
2
by: Christian Stooker | last post by:
Part one: ====== Hi ! I want to use SQLite database like the FireBird database: with big isolation level. What's that meaning ? I have an application that periodically check some input...
0
by: sandi | last post by:
I have Parent child table as decribe below: Parent Table name = TESTPARENT 1. counter bigint isIdentity=Yes Increment=1 Seed=1 2. customer nChar(10) Child Table name = TESTCHILD...
5
by: ashley.ward | last post by:
I am attempting to write a program with VB 2005 Express Edition which accesses an Oracle 9 database and dumps the results of three SELECT queries into a spreadsheet file once every hour. ...
1
by: cricketweb | last post by:
I have a stored procedure that calls another stored procedure with the first stored procedure opening a transaction: BEGIN SET XACT_ABORT ON BEGIN TRANSACTION does various updates/inserts
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.