Page 1 of 1
Static method Database.Delete(DbConnection) from EntityFramework.dll doesn't work
Posted: Sat 29 Mar 2014 15:12
by Dennis Wanke
Static method EntityFramework!Database.Delete(DbConnection) has no effect when dotConnect OracleConnection is supplied as a parameter (direct mode, user's schema in the database is not empty). Tried it with all different values of DatabaseScript.Schema.DeleteDatabaseBehaviour with the same result.
Expected behavior is to be the same as when calling ObjectContext.DeleteDatabase() for a context created with the same database connection.
In fact, Database.Delete() calls ObjectContext.DeleteDatabase() internally for a specially constructed "empty" context:
Code: Select all
DbModelBuilder().Build(connection).Compile().CreateObjectContext<ObjectContext>(connection)
As no StoreItemCollection is supplied in this case, the only viable option would be to delete the entire user's schema (which probably corresponds to DeleteDatabaseBehaviour.AllSchemaObjects or DeleteDatabaseBehaviour.Schema).
Similar issue:
http://forums.devart.com/viewtopic.php?f=1&t=29261
Re: Static method Database.Delete(DbConnection) from EntityFramework.dll doesn't work
Posted: Wed 02 Apr 2014 11:59
by Shalex
There is a difference in the meaning of schemas/databases between SQL Server and Oracle:
http://stackoverflow.com/questions/5365 ... oft-schema.
Dennis Wanke wrote:Static method EntityFramework!Database.Delete(DbConnection) has no effect when dotConnect OracleConnection is supplied as a parameter (direct mode, user's schema in the database is not empty).
Which behaviour did you expect? There is no way to delete a database user which is used to establish a current connection.
We will investigate the possibility of implementing the following behaviour: Database.Delete(DbConnection) should remove all objects in the current schema (specified in the
User Id or set with
Initialization Command connection string parameter) if DatabaseScript.Schema.DeleteDatabaseBehaviour = AllSchemaObjects.
Initialization Command specifies a database-specific command that should be executed immediately after establishing the connection.
Re: Static method Database.Delete(DbConnection) from EntityFramework.dll doesn't work
Posted: Wed 02 Apr 2014 13:24
by Dennis Wanke
This is exactly what I suggested:
Dennis Wanke wrote:
Expected behavior is to be the same as when calling ObjectContext.DeleteDatabase() for a context created with the same database connection.
...
As no StoreItemCollection is supplied in this case, the only viable option would be to delete the entire user's schema (which probably corresponds to DeleteDatabaseBehaviour.AllSchemaObjects ...)
Re: Static method Database.Delete(DbConnection) from EntityFramework.dll doesn't work
Posted: Wed 09 Apr 2014 14:13
by Shalex
The Database.Delete(DbConnection) functionality is supported: all objects in the current schema (specified in User Id or set with Initialization Command connection string parameter) are removed if DatabaseScript.Schema.DeleteDatabaseBehaviour = AllSchemaObjects. We will notify you when the corresponding build of dotConnect for Oracle is available for download.
Re: Static method Database.Delete(DbConnection) from EntityFramework.dll doesn't work
Posted: Thu 10 Apr 2014 14:13
by Shalex
New build of dotConnect for Oracle 8.3.135 is available for download!
It can be downloaded from
http://www.devart.com/dotconnect/oracle/download.html (trial version) or from Registered Users' Area (for users with active subscription only).
For more information, please refer to
http://forums.devart.com/viewtopic.php?f=1&t=29348.
Re: Static method Database.Delete(DbConnection) from EntityFramework.dll doesn't work
Posted: Fri 11 Apr 2014 09:53
by Dennis Wanke
I confirm the issue is now fixed.