?
Solved

Need of using BeginTrans and CommitTrans

Posted on 2000-04-02
2
Medium Priority
?
450 Views
Last Modified: 2012-06-27
Hi.... why cannot I executed a SQL statement without enclosing it by BeginTrans and CommitTrans instructions? what do they really do?

Thanks
Skel
0
Comment
Question by:skel
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 

Expert Comment

by:chsoh
ID: 2678774
The main purpose of transaction is make data isolation so that multiple users can access data simultaneously without interfering with one another.

When you execute a SQL begin with BeginTrans, you MUST execute the CommiTrans or RollbackTrans to either make the transaction success or Undo the transaction.

This is becoz when you execute the BeginTrans, all the statements & instruction under BeginTrans will be keeped & recorded before it actually done on database. The statements between BeginTrans and CommitTrans will be actually done after the CommitTrans statement, or cancelled if RollbackTrans.

anythings need to know ?
0
 
LVL 4

Accepted Solution

by:
srikant033100 earned 150 total points
ID: 2679431
Hi
Skel
You actually need a begin Trans to tell to the RDBMS that it is actuall starting a new transaction and it is very important to maintain the consistencies of data. Untill u start with a begin trans or end with an commit or rollback it is very difficult to maintain the database at a consistent and accurte level. That is why every transaction or else a set or action which together we call as transaction has to start with a begin trans and end with end trans or rollback with rollback.

0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Your data is at risk. Probably more today that at any other time in history. There are simply more people with more access to the Web with bad intentions.
In this blog post, we’ll look at how using thread_statistics can cause high memory usage.
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question