Oraclesession.Preferences

Jens Fudickar

Member³
Hello Marco,
i have a problem using the following Statement:

MainOracleSession.Preferences := otSession.Preferences;
MainOracleSession.connected := otSession.connected;

Using this code will work. The only problem is, that when closing the application an exception raised:
Die Anwendung in "0x00fdb9b0b" verweist auf Speicher in "0x00000000". Der Vorgang "written" konnten nicht auf den Speicher durchgef
 
I had the same problem - EAccessViolation when exiting program if there was any TSessionPreferences assignments. I think these this is because each TSessionPreferences holds a pointer to it's TOracleSession; but TOracleSession::Preferences property doesn't adjust this pointer on assigning (it simply assigns to FPreferences). So, old TSessionPreferences are "lost" and new are deleted twice. When program exits, BCB or Delphi memory manager scans for and deletes all created objects. It seems like exception is thrown when it attempts to delete "lost" TSessionPreferences but it's session is no longer exists.
I solve this problem by assigning all nesessary preferences (UseOCI7, etc) manually.
 
You are right, this is indeed a nasty bug. Especially because the symptoms do not really provide a clue for the actual cause of the problem. We will fix this for the next release and define proper Assign procedures for the TPersistent properties.

------------------
Marco Kalter
Allround Automations
 
Back
Top