[Zope-DB] Re: DCOracle2 Error: (1012, 'ORA-01012: not logged on')
Matthew T. Kromer
matt at zope.com
Mon Sep 22 08:45:43 EDT 2003
This error is curious, because it's coming from the commit or rollback
call to the database connection.
This should only happen when that connection object is used during the
course of a transaction, ie someone DID something to the database. Yet
then the database connection went away. It's likely that Oracle was
restarted or someone closed the connection (contrary to Dieter's
experience, I've never seen Oracle crash).
The normal try/except pairing in ZOracleDA's code doesn't handle oracle
errors arising during commit or rollback. I'd argue it's PROBABLY doing
the right thing letting it complain about this, since the proper time to
notice the database went away was before trying to commit or abort.
Having said that, if you want to monkey with the DA code a little bit,
there IS support for two-phase commit in DCOracle2, just not in
ZOracleDA. What you'll need to do is catch the tpc_vote call and then
do a connection.prepare(), and then I think you also need to change the
connection.commit() to connection.commit(twophase=1) [n.b. I'm not sure
if you don't have to commit twice, once with twophase=1 and once without].
The tpc_vote phase is allowed to raise an error, and the
connection.prepare() should see that the connection to Oracle is down
just like the commit/rollback sees.
Chris Withers wrote:
> Hi,
>
> Has anyone seeen errors similar to this:
>
> Error Type: Database Error
> Error Value: (1012, 'ORA-01012: not logged on')
>
> ...being returned to the user, accompanied by this pair of messages in
> the event log:
>
> ------
> 2003-05-06T08:58:30 PANIC(300) ZODB A storage error occurred in the
> last phase of a two-phase commit. This shouldn't happen.
> Traceback (innermost last):
> File /usr/local/Zope-2.6.1-src/lib/python/ZODB/Transaction.py, line
> 356, in _finish_one
> File /usr/local/Zope-2.6.1-src/lib/python/Shared/DC/ZRDB/TM.py, line
> 56, in tpc_finish
> File /usr/local/Zope-2.6.1-src/lib/python/Products/ZOracleDA/db.py,
> line 125, in _finish
> File
> /usr/local/Zope-2.6.1-src/lib/python/Products/ZOracleDA/DCOracle2/DCOracle2.py,
> line 286, in commit
> DatabaseError: (3114, 'ORA-03114: not connected to ORACLE')
> ------
> 2003-05-06T08:58:30 ERROR(200) ZODB A storage error occured during
> object abort. This shouldn't happen.
> Traceback (innermost last):
> File /usr/local/Zope-2.6.1-src/lib/python/ZODB/Transaction.py, line
> 400, in _commit_error
> File /usr/local/Zope-2.6.1-src/lib/python/Products/ZOracleDA/db.py,
> line 128, in _abort
> File
> /usr/local/Zope-2.6.1-src/lib/python/Products/ZOracleDA/DCOracle2/DCOracle2.py,
> line 291, in rollback
> DatabaseError: (3114, 'ORA-03114: not connected to ORACLE')
>
> cheers,
>
> Chris
>
>
--
Matt Kromer
Zope Corporation http://www.zope.com/
More information about the Zope-DB
mailing list