Drop Table

Support Forum for database administrators and web based access to important newsgroups related to databases
Register on Database Support Forum Edit your profileCalendarFind other Database Support forum membersFrequently Asked QuestionsSearch this forum -> 
For Database admins: Free Database-related Magazines Now Free shipping to Texas


Post New Thread










Thread
Author

is it better to use Begin-Commit?
Hi All,
is it better to use Begin...Commit in all SP?
does this help preventing deadlocks?

thanks in advance.
jouj


Report this thread to moderator Post Follow-up to this message
Old Post
jouj
03-01-06 01:23 AM


Re: is it better to use Begin-Commit?
It is not that simple. Serializing the access though some objects can in som
e cases reduce the
likelihood for deadlocks. But it can also have the opposite effect, as locks
 will be held for a
longer time increasing the risk that two or more operations executes partly 
concurrently. Also, you
need proper error handling, and not just add begin tran and commit tran, or 
you will not have the
desired logic. Analyze the requirements for your modifications and code your
 transactions according
to that.

--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www. solidqualitylearning
.com/
Blog: http:// solidqualitylearning
.com/blogs/tibor/


"jouj" <jouj@discussions.microsoft.com> wrote in message
news:D0FB6737-8D16-4BF3-9FD9- E640AF51EAC8@microso
ft.com...
> Hi All,
> is it better to use Begin...Commit in all SP?
> does this help preventing deadlocks?
>
> thanks in advance.
> jouj
>


Report this thread to moderator Post Follow-up to this message
Old Post
Tibor Karaszi
03-01-06 01:23 AM


RE: is it better to use Begin-Commit?
Jouj,
Using this, your entire transaction will not be committed until you use
commit tran. It is good to use is sp in error trapping, since if an error
occurred somewhere, you can jump to an Error section and use 'rollback
transactions' command to undo the entire set of transactions.

I have noticed that after you open the transactions, (from begin tran) to
till you close the transactions (Commit or Rollback), update tables are
locked for modifications.

We use this in transactions than need to happen in all or nothing manner.


Report this thread to moderator Post Follow-up to this message
Old Post
bluefish
03-01-06 01:23 AM


Sponsored Links





Last Thread Next Thread
Post New Thread

MS SQL Server archive

Show a Printable Version Email This Page to Someone! Receive updates to this thread
Microsoft SQL Server
Access database support
PostgreSQL Replication
SQL Server ODBC
FoxPro Support
PostgreSQL pgAdmin
SQL Server Clustering
MySQL ODBC
Web Applications with dBASE
SQL Server CE
MySQL++
Sybase Database Support
MS SQL Full Text Search
PostgreSQL Administration
SQL Anywhere support
DB2 UDB Database
Paradox Database Support
Filemaker Database
Berkley DB
SQL 2000/2000i database
ASE Database
Forum Jump:
All times are GMT. The time now is 10:16 AM.

 
Mobile devices forum | Database support forum archive




Copyrights DropTable.com Database Support Forum 2004 - 2006