ORA-22924

Forum related to Oracle Server

Moderators: gto, EgonHugeist, mdaems

Post Reply
User avatar
aehimself
Zeos Dev Team
Zeos Dev Team
Posts: 796
Joined: 18.11.2018, 17:37
Location: Hungary

ORA-22924

Post by aehimself »

Theoretical question, I think I know the answer I'm just looking for confirmation and possible solutions.

I have a READ-ONLY worker thread, which processes a large number of CLOB data. LOBs are loaded upon access, not when opening the dataset. After ~2 days of continuous running I was greeted with the following error:

Other OCILobRead2 ORA-01555: snapshot too old: rollback segment number with name "" too small ORA-22924: snapshot too old (#1555)

All of my worker threads derive from the same base thread, which (as most of my workers do updates in the database as well) sets the ZConnection.AutoCommit to false before connecting and therefore enables transactions. What I understand from this error is that it appears when a transaction is too long, we should commit / roll back more often. This is easily the source at me since I had a transaction which is ~2 days old.

Now, if I override this functionality and set AutoCommit to True in this worker, will it solve my issue? Or should I do a Connection.Rollback every 30 minutes...? This feels kinda hacky...

Any opinion is welcome :)
Delphi 12.2, Zeos 8 from latest GIT snapshot
Using:
- MySQL server 8.0.18; libmysql.dll 8.0.40 x64 5.7.19 x68, libmariadb.dll 3.3.11
- Oracle server 11.2.0, 12.1.0, 19.0.0; oci.dll 21.15
- MSSQL 2012, 2019; sybdb.dll FreeTDS_3102
- SQLite 3.47
marsupilami
Platinum Boarder
Platinum Boarder
Posts: 1956
Joined: 17.01.2011, 14:17

Re: ORA-22924

Post by marsupilami »

An equally theoretical answer ;) :
I seem to remember that Egonhugeist told me that Oracle doesn't have a true AutoCommit mode and so Zeos somehow simulates it. In that case I wouldn't trust the emulation too much and do a commit or rollback from time to time myself.
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Re: ORA-22924

Post by EgonHugeist »

Jan, there is no emulation about "autocommit" for Oracle. It's simply not supported see: https://docs.oracle.com/cd/E11882_01/ap ... LNOCI17163 patameter "mode". we just send OCI_COMMIT_ON_SUCCESS if the connection is in AutoCommit mode.
Best regards, Michael

You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/

Image
marsupilami
Platinum Boarder
Platinum Boarder
Posts: 1956
Joined: 17.01.2011, 14:17

Re: ORA-22924

Post by marsupilami »

EgonHugeist wrote: 18.03.2021, 18:23 we just send OCI_COMMIT_ON_SUCCESS if the connection is in AutoCommit mode.
I assume, this is what I meant when I said:
marsupilami wrote: 19.02.2021, 21:26 Oracle doesn't have a true AutoCommit mode and so Zeos somehow simulates it.
But then - to me it seems that using OCI_COMMIT_ON_SUCCESS with OCIStmtExecute comes pretty close to a true autocommit mode - so using it should be quite safe when compared with the things we once did with dblib and Firebird...
Post Reply