#1 2015-03-23 22:49:10

ASiwon
Member
From: Poland
Registered: 2015-01-30
Posts: 82

Two Oracle and mORMot question

Hello,

I have two questions related to the user rights and Oracle in mORMot:
1. Is it possible to set role while creating connection to the Oracle using mORMot?
2. Is it possible to give an information about request of password change while logging in to the Oracle database? I'm asking because since Oracle 11 are used the default policy even for SYSTEM account and requires to change password after some time period. Using other Delphi components to connecting to the Oracle I'm usually checking password grace period. If exception: ORA-28001 or ORA-28002 is raised then application knows that it should automatically change its password. Is it something similar in mORMot?


best regards
Adam Siwon

Offline

#2 2015-03-24 09:40:41

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,718
Website

Re: Two Oracle and mORMot question

It is up to the application/server code to handle those Oracle-specific behaviors.
But there was some missing events in our SynDB units.

I've added the new speConnected / speDisconnected events for TSQLDBConnectionProperties/TSQLDBConnection.OnProcess event handlers.
So you may be able to set the roles at connection.
See http://synopse.info/fossil/info/046e9e17fe

I've also added the new TSQLDBConnectionProperties.OnStatementInfo event, to be used e.g. to track ORA-28001 or ORA-28002 warnings about account expire.
See http://synopse.info/fossil/info/1f921ffa18

Feedback is welcome, since we did not test those new events intensively yet.

Offline

#3 2015-03-25 21:23:04

ASiwon
Member
From: Poland
Registered: 2015-01-30
Posts: 82

Re: Two Oracle and mORMot question

Thank you very much. I will try to use this.


best regards
Adam Siwon

Offline

#4 2015-03-26 22:42:00

wloochacz
Member
Registered: 2015-01-03
Posts: 45

Re: Two Oracle and mORMot question

ASiwon wrote:

Thank you very much. I will try to use this.

<pl mode on>Adam, Arnaud szybciej to robi, niż Ty jesteś w stanie odczytać tongue<pl mode off>
Arnaud Bouchez, YOU ARE fu....gFANTASTIC-robo-architect-blogger-TOP-coder!!! AMAZING! GREAT WORK!!!!
I'm jealous ;-)

Offline

#5 2015-07-23 20:08:02

ASiwon
Member
From: Poland
Registered: 2015-01-30
Posts: 82

Re: Two Oracle and mORMot question

Hello,

I have checked changes you made. I'm sorry for the delay. OnProcess event works as expected. I can set correct roles for user.

Second change does not works. When I'm trying to login into the Oracle server using account which has status expired then regular exception ORA-28001 with message: the password has expired@' extended_errorcode = 1 is raised and logging process is interrupted. OnStatementInfo event is never fired. When I'm trying to login to the Oracle using this same account in other tools then they wants to get new password for account.

Is it possible to add to the OnStatementInfo event additional parameter with error code? Testing code value will be easier to get information about event calling reason than parse message text.

Last edited by ASiwon (2015-07-23 20:49:50)


best regards
Adam Siwon

Offline

#6 2015-07-25 16:58:52

ASiwon
Member
From: Poland
Registered: 2015-01-30
Posts: 82

Re: Two Oracle and mORMot question

Hello,

I have checked code and I found where the problem exists. ORA-28001 exception has status OCI_ERROR not OCI_SUCCESS_WITH_INFO. Thats why exception is raised and OnStatementInfo event is never fired. So I think ORA-28001 error should be supported separately. I wrote some changes to the SynDBOracle unit which could to handle password changing when it is expired. Modified version of file is available at: http://gidex.com.pl/download/SynDBOracle.pas. You could use those changes if they are valuable for you.

Those changes was made only for Oracle so I made changes only in SynDbOracle unit. I think some changes could be moved to the base classes to better integration with mORMot library.


best regards
Adam Siwon

Offline

#7 2015-07-25 18:00:28

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,718
Website

Re: Two Oracle and mORMot question

As been integrated as http://synopse.info/fossil/info/f6ec234e8a

Thanks Adam for the patch!
cool

Offline

Board footer

Powered by FluxBB