Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Access Violation with Oracle and connection lost



Permlink Replies: 2 - Last Post: Nov 23, 2016 11:24 PM Last Post By: Dmitry Arefiev
Pascal Bellebou...

Posts: 21
Registered: 6/12/04
Access Violation with Oracle and connection lost
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 9, 2016 7:27 AM
Here a very simple test :
Create New VCL project.
Drop a FDConnection and FDQuery.
Configure FDConnection as above (Oracle).
The FDQuery does the following query : "Select 1 From Dual"
Launch exe, connect and execute query : OK.
Disconnect from network (ie unplugging ethernet cable) to loose the connection to Oracle Database.
Try to Execute query again give the following Access Violation (sorry French message) :
Violation d'accès à l'adresse 069DE1C8 dans le module 'FireDACOracleDriver240.bpl'. Lecture de l'adresse 00000020

After deep debug, we found out the issue is here :
FireDAC.Phys.Oracle.TFDPhysOracleTransaction.InternalCheckState($31C60D0,False)
FireDAC.Phys.TFDPhysTransaction.InternalNotify((hors limite) 36,$31C60D0)
FireDAC.Phys.Oracle.TFDPhysOracleTransaction.InternalNotify(cpAfterCmdExecuteFailure,$31C60D0)
FireDAC.Phys.TFDPhysTransaction.Notify((hors limite) 36,$31C60D0)
FireDAC.Phys.TFDPhysCommand.OpenBase
FireDAC.Phys.TFDPhysCommandAsyncOpen.Execute
FireDAC.Stan.Async.TFDStanAsyncExecutor.ExecuteOperation(False)
FireDAC.Stan.Async.TFDStanAsyncExecutor.Run
FireDAC.Phys.TFDPhysCommand.ExecuteTask(TFDPhysCommandAsyncOpen($322C600) as IFDStanAsyncOperation,TFDCommand($31A4020) as IFDStanAsyncHandler,True)
FireDAC.Phys.TFDPhysCommand.Open(True)
FireDAC.Phys.TFDPhysCommand.OpenBlocked
FireDAC.Phys.Oracle.TFDPhysOracleCommand.InternalColInfoStart(('', -1, '', -1))
FireDAC.Phys.TFDPhysCommand.DoDefineDataTable($327B080,nil,-1,'',mmOverride)
FireDAC.Phys.TFDPhysCommand.Define($327B080,nil,mmOverride)
FireDAC.DApt.TFDDAptTableAdapter.Define
FireDAC.Comp.Client.TFDCustomTableAdapter.Define
FireDAC.Comp.Client.TFDAdaptedDataSet.DoDefineDatSManager
FireDAC.Comp.DataSet.TFDDataSet.CheckTable
FireDAC.Comp.DataSet.TFDDataSet.OpenCursor(False)
FireDAC.Comp.Client.TFDRdbmsDataSet.OpenCursor(False)
Data.DB.TDataSet.SetActive(???)
FireDAC.Comp.DataSet.TFDDataSet.SetActive(???)
Data.DB.TDataSet.Open
FireDAC.Comp.Client.TFDRdbmsDataSet.Open(???,(...),(...))
FireDAC.Comp.Client.TFDRdbmsDataSet.Open(???)
Unit28.TForm28.Button2Click($31BCCC0)

The second condition "OraConnection.FEnv.Lib.Version >= cvOracle120000" raise an Exception (Access violation) because the OraConnection.FEnv is nil.

Here are the connection infos :

================================
Paramètres de définition de connexion
================================
Database=DIANE
User_Name=SYSDIANE4
Password=*****
DriverID=Ora
================================
FireDAC info
================================
Tool = RAD Studio 10.1 Berlin
FireDAC = 15.0.1 (Build 86746)
Platform = Windows 32 bit
Defines = FireDAC_NOLOCALE_META;FireDAC_MONITOR
================================
Infos client
================================
Loading driver Ora ...
Recherche de Instant Client ...
Non trouvé
Recherche du Home Oracle ...
Vérification du Home Oracle dans la clé [\Software\Oracle] ...
Vérification du Home Oracle dans la clé [\Software\Oracle\KEY_OraClient11g_home1] ...
Trouvé : [C:\app\PascalB\product\11.2.0\client_1\bin\oci.dll], position : [2147483647], dans [reg: \Software\Oracle\KEY_OraClient11g_home1]
Home = C:\app\PascalB\product\11.2.0\client_1
Version = 1102000100
OCI DLL name = C:\app\PascalB\product\11.2.0\client_1\Bin\OCI.DLL
TNSNAMES dir = C:\app\PascalB\product\11.2.0\client_1\Network\Admin\tnsnames.ora
NLS_LANG = FRENCH_FRANCE.WE8MSWIN1252
================================
Informations de session
================================
Vérification de la session...
Avertissement : la version du client [11.2.0.1.0 Production] ayant un numéro de version inférieur peut être instable.
Current catalog =
Current schema = SYSDIANE4
Server ver = Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
Use DBA views = True
Decimal sep = ,
Client character set = WE8MSWIN1252
DB character set = WE8MSWIN1252
NDB character set = AL16UTF16
Database bytes/char = 1

Pascal.

Pascal Bellebou...

Posts: 21
Registered: 6/12/04
Re: Access Violation with Oracle and connection lost
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 23, 2016 3:29 AM   in response to: Pascal Bellebou... in response to: Pascal Bellebou...
Is there anybody who can reproduce the issue ?
Is it related to our environment / Connection Settings ?

Pascal.
Dmitry Arefiev

Posts: 1,406
Registered: 12/7/03
Re: Access Violation with Oracle and connection lost
Click to report abuse...   Click to reply to this thread Reply
  Posted: Nov 23, 2016 11:24 PM   in response to: Pascal Bellebou... in response to: Pascal Bellebou...
Yes, reproduced. As a workaround you can apply the following patch, if you have FireDAC sources:
* open FireDAC.Phys.Oracle.pas unit
* locate there TFDPhysOracleTransaction.InternalCheckState method
* add code to top of this method:
  if OraConnection.FEnv = nil then
    Exit;

* add path to FireDAC sources to your IDE Library Path

--
With best regards,
Dmitry
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02