Page 1 of 1

Grant in EF6 Migration: ORA-01003: no statement parsed

Posted: Thu 25 Jan 2018 12:52
by PeterUser
Hello

I updated from dotConnect for Oracle 9.4.326 to 9.5.429.

With the new version, I have a problem with an migration, that was working fine before. My migration contains some GRANT SQL statements like

Code: Select all

Sql("GRANT SELECT, INSERT, UPDATE, DELETE ON TABLE TO CLIENT_USER");
When I run them I get the message:

Code: Select all

Update-Database -Verbose -ProjectName Qm.Tda.Dal -ConnectionString "xxx" -ConnectionProviderName "Devart.Data.Oracle"
Using StartUp project 'Qm.Tda.Api'.
Specify the '-Verbose' flag to view the SQL statements being applied to the target database.
Target database is: '' (DataSource: localoracle, Provider: Devart.Data.Oracle, Origin: Explicit).
Applying explicit migrations: [...].
Applying explicit migration: xxx.
GRANT SELECT, INSERT, UPDATE, DELETE ON TABLE TO CLIENT_USER
Devart.Data.Oracle.OracleException (0x80004005): ORA-01003: no statement parsed
   at Devart.Data.Oracle.cr.d()
   at Devart.Data.Oracle.d2.o()
   at Devart.Data.Oracle.d2.a()
   at Devart.Data.Oracle.d3.a()
   at Devart.Data.Oracle.d4.a(d2 A_0, Int32 A_1)
   at Devart.Data.Oracle.d4.a(Int32 A_0, eb A_1)
   at Devart.Data.Oracle.OracleCommand.InternalExecute(CommandBehavior behavior, IDisposable disposable, Int32 startRecord, Int32 maxRecords, Boolean nonQuery)
   at Devart.Common.DbCommandBase.ExecuteDbDataReader(CommandBehavior behavior, Boolean nonQuery)
When I create a SQL script using the -Script option, I can execute it in SqlDeveloper without any problem. So this is not a big problem for now.

Greetings
Peter

Re: Grant in EF6 Migration: ORA-01003: no statement parsed

Posted: Tue 30 Jan 2018 15:59
by Shalex
Thank you for your report. We will investigate the issue and notify you about the result.

Could you specify the exact version (x.x.x) of your EntityFramework package?

Re: Grant in EF6 Migration: ORA-01003: no statement parsed

Posted: Thu 01 Feb 2018 13:04
by Shalex
We cannot reproduce the issue with dotConnect for Oracle v9.5.429 in our environment. Please specify:
a) the version (x.x.x) of your EntityFramework package
b) the version (x.x.x.x) of your Oracle Server
c) if you are connecting via Oracle Client, tell us its version (x.x.x.x)

Re: Grant in EF6 Migration: ORA-01003: no statement parsed

Posted: Thu 01 Feb 2018 14:45
by PeterUser
Hm. I start wondering what I am doing wrong with my project.

So here we go:
Oracle

Code: Select all

Oracle Database 12c Standard Edition Release 12.1.0.2.0 - 64bit Production
PL/SQL Release 12.1.0.2.0 - Production
"CORE	12.1.0.2.0	Production"
TNS for Linux: Version 12.1.0.2.0 - Production
NLSRTL Version 12.1.0.2.0 - Production
Entity Framework 6.2.0

I use direct connection with

Code: Select all

-ConnectionString "user id=xx ; password=yy ; server=localoracle;direct=True; sid=xe; persist security info=True; Connection Timeout=2; Unicode=true" 
-ConnectionProviderName "Devart.Data.Oracle"
I will try to create a toy project and try to reproduce my issues there. That way I can also share the project with you.

Re: Grant in EF6 Migration: ORA-01003: no statement parsed

Posted: Thu 01 Feb 2018 16:07
by PeterUser
I created a new solution, added latest EF and dotConnect for Oracle and created a migration with an custom SQL statement. When I try to run the migration with

Code: Select all

Update-Database -StartUpProjectName Startup -ProjectName DAL -Verbose
and it failed:

Code: Select all

GRANT SELECT ON "Parents" TO LOCALTEST
Devart.Data.Oracle.OracleException (0x80004005): ORA-01003: no statement parsed
   at Devart.Data.Oracle.cr.d()
   at Devart.Data.Oracle.d2.o()
   at Devart.Data.Oracle.d2.a()
   at Devart.Data.Oracle.d3.a()
   at Devart.Data.Oracle.d4.a(d2 A_0, Int32 A_1)
   at Devart.Data.Oracle.d4.a(Int32 A_0, eb A_1)
   at Devart.Data.Oracle.OracleCommand.InternalExecute(CommandBehavior behavior, IDisposable disposable, Int32 startRecord, Int32 maxRecords, Boolean nonQuery)
   at Devart.Common.DbCommandBase.ExecuteDbDataReader(CommandBehavior behavior, Boolean nonQuery)
I used the Oracle server from my last post.

I uploaded my project as "Migration No statement parsed.zip" onto your ftp server.

Can you reproduce that?

Greetings
Peter

Re: Grant in EF6 Migration: ORA-01003: no statement parsed

Posted: Tue 06 Feb 2018 19:26
by Shalex
Thank you for the test project. We have reproduced "ORA-01003: no statement parsed" and are investigating the problem. We will notify you about the result.

Re: Grant in EF6 Migration: ORA-01003: no statement parsed

Posted: Tue 20 Mar 2018 12:27
by PeterUser
Hello

Is there any update on this issue?

Greetings
Peter

Re: Grant in EF6 Migration: ORA-01003: no statement parsed

Posted: Wed 21 Mar 2018 17:04
by Shalex
The bug is fixed. Look forward to the next public build of dotConnect for Oracle (approximate timeframe is one week).

Re: Grant in EF6 Migration: ORA-01003: no statement parsed

Posted: Fri 30 Mar 2018 17:20
by Shalex
The bug with executing the GRANT statement in the Direct mode is fixed: viewtopic.php?f=1&t=36966.