Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Databases

About Transacations BEgin, Commit, Auto-commit.

What do you mean by some systems don't have autocommit turned on and thus we need to begin and commit after each statement. I remember you talked ABOUT IT IN the transactions section. The problem is I don't get why you would need to begin if you did not have to turn off autocommit cause it doesn't exist.

1 Answer

Steven Parker
Steven Parker
229,644 Points

Not all databases have an autocommit feature that you can turn on and off.

This information only applies to those which do. And if it is turned off, any changes you make will not be permanent until you give the commit command.

So then, if the db doesn't autocommit, then we need to:

begin

statement

commit

for each statement?

or would we just commit at the end

statement statement

commit;

Steven Parker
Steven Parker
229,644 Points

I can't speak for all databases, but ones I have used personally allow you to perform multiple statements with one commit at the end.