I'm just wondering - and I tried to look it up in the documentation:
When I submit a dbms_job calling a pl/sql-procedure and this procedure
does some data-changes - is it for sure that this changes are
commited? (There is no commit in the procedure.)
I've tried with a little test-case and the job's changes seem to be
commited - but I'm not sure if this is standard behaviour. Is it
possible to submit a job that does no implicit commit?
Thanks,
stephan
Oh, my version of Oracle is 10g - but I assume my question is general
and not version-dependent ...
> I'm just wondering - and I tried to look it up in the documentation:
> When I submit a dbms_job calling a pl/sql-procedure and this procedure
> does some data-changes - is it for sure that this changes are
> commited? (There is no commit in the procedure.)
> I've tried with a little test-case and the job's changes seem to be
> commited - but I'm not sure if this is standard behaviour. Is it
> possible to submit a job that does no implicit commit?
From Chapter 6 of the PL/SQL User's Guide and Reference:
"You should explicitly commit or roll back every transaction.
Whether you issue the commit or rollback in your PL/SQL program or from
a client program depends on the application logic. If you do not commit
or roll back a transaction explicitly, the client environment determines
its final state."
Clearly DBMS_JOB commits automatically (although I imagine it issues a rollback
if the job throws an error). This is really the required behavior - if it didn't,
how would you commit the changes? Bear in mind that the job will run in its own
session.
--
_______________________________________________________________________
Dan Blum to...@panix.com
"I wouldn't have believed it myself if I hadn't just made it up."
Besides what Dan Blum noted, see metalink Note:61730.1.
>
> Thanks,
> stephan
>
> Oh, my version of Oracle is 10g - but I assume my question is general
> and not version-dependent ...
See http://www.orafaq.com/maillist/oracle-l/2005/02/09/0440.htm (I
think there are more specific posts floating around somewhere that
explain how things change, but that was found with a quick google).
Also see http://www.pythian.com/blogs/398/dbms_scheduler-and-implicit-commits
jg
--
@home.com is bogus.
"A pilot who doesn't have any fear probably isn't flying his plane
to its maximum." - Jon McBride, astronaut
oh thanks, that explains. but surely it's better to issue explicit
commits and not to rely on the implicit one - and if it's only to make
the code more readable
regards,
stephan
As Dan quoted from Oracle's own documentation: ""You should explicitly
commit or roll back every transaction."
So, commit (or rollback, depending on your logic) as required.
HTH
-g
Palooka
Yeah, I was hoping the pythian blog reference would key people to
that. But far be-it for me to dictate that advice without knowing the
scope of the OP's issue.
jg
--
@home.com is bogus.
Spider early and often. http://www.pcpro.co.uk/news/214371/google-blogger-hosts-2-of-worlds-malware.html
Cheers.
Palooka