Solved

No Begin Trans in Oracle??

Posted on 2004-08-03
9
6,099 Views
Last Modified: 2008-01-09
Hi,

I noticed that there is no begin trans in Oracle.  Is this true?  Therefore, does this mean that there is an implicit begin trans, and if I do not do a commit at the end of a session that all of the information will be lost once the database is shut down and restarted?

Thanks for clarifying in advance,
-StevenLogic
0
Comment
Question by:StevenLogic
[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
9 Comments
 
LVL 22

Expert Comment

by:Helena Marková
ID: 11701951
If you don't use commit then all changes will be lost.
0
 
LVL 22

Expert Comment

by:earth man2
ID: 11702425
to start a transaction use a savepoint.


savepoint a_bridge_too_far;

update x set col1='Wow';

rollback to a_bridge_too_far;
0
 
LVL 22

Expert Comment

by:earth man2
ID: 11702443
if you do not commit changes are lost when connection is closed.  Also changes are not visible to other connections.
0
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 

Author Comment

by:StevenLogic
ID: 11703125
That's what I thought, but currently I have no commit/save point/rollback, and information is saved after connection is closed, and is available to other users.  If I can get away without a transaction, it would be good, since this process doesn't really require it.

Save points are different to Begin trans in that you can have multiple save points.  Under Oracle, does save point take the place of a Begin Trans?

Thanks,
-StevenLogic
0
 
LVL 22

Accepted Solution

by:
earth man2 earned 250 total points
ID: 11703333
It depends what you are using as your interface and ODBC connection might autocommit as default.

exit command in sql*plus will commit and return to OS$ by default.

ie exit commit; is same as exit; or exit rollback; if you want to discard changes.

You don't need a begin transaction you get one for free on the first dml statement.
0
 

Author Comment

by:StevenLogic
ID: 11703809
thanks earthman2.  So ADO must be doing the work for me.  I was confused by what was hapenning where 'till now.  Am using ADO with a stored procedure.

So to summarise, no commit, then no changes available after session closed.

Thanks very much.
0
 
LVL 35

Expert Comment

by:Mark Geerlings
ID: 11707110
If you have experience with SQL Server (or another SQL-based database as I'm assuming you do, since you know what "begin trans" means) but are new to Oracle, you should be aware that there are many differences between SQL Server and Oracle.  Some of the biggest differences are in these areas:
1. how nulls are handled
2. how dates are handled
3. how record-locking is handled
4. whether stored procedures return result sets (arrays) or not

Many people who are new to Oracle and expect it to work like SQL Server in these areas are unpleasantly surprised.  I'm not saying the Oracle way or the SQL Server way is better or worse in these areas, I'm just reminding you that they are different and if you write code based on how things work in one database, the results may be different in the other.
0
 
LVL 11

Expert Comment

by:vc01778
ID: 11708390
"Under Oracle, does save point take the place of a Begin Trans?
"

No, it plays a different role.

Under Oracle,  all transactions are started implicitly (similar to ms sql 'set implicit_transaction on')  and you do need an expliit commit/roolback in order to finish a transaction.

VC
0
 

Author Comment

by:StevenLogic
ID: 11713911
Thanks everyone for your help.  I'll do some experiments to determine what ADO is doing.
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Working with Network Access Control Lists in Oracle 11g (part 1) Part 2: http://www.e-e.com/A_9074.html So, you upgraded to a shiny new 11g database and all of a sudden every program that used UTL_MAIL, UTL_SMTP, UTL_TCP, UTL_HTTP or any oth…
Shell script to create broker configuration file using current broker Configuration, solely for purpose of backup on Linux. Script may need to be modified depending on OS-installation. Please deploy and verify the script in a test environment.
Via a live example show how to connect to RMAN, make basic configuration settings changes and then take a backup of a demo database
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…

738 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