DbType.Int64 not really possible for OracleParameter??

DbType.Int64 not really possible for OracleParameter??

Postby HCRoman » Wed 23 Mar 2011 14:36

Hi devart team,

Background:
I have written a small Extension for the ObjectContext to handle verry performant inserts for large EntityObject enumerations.

public static int InsertByCommand(this ObjectContext objectContext, bool returnIdentityOrGeneratedValues, IEnumerable entitiesToInsert) where T : EntityObject
{
...
}

this extension creates as many as needed OracleCommands and executes them via dynamically created INSERT-Statement for all EdmProperties of T and calls ExecuteArray for the (ObjectContext.Connection as EntityConnection).StoreConnection.
Each identity or computed Property is mapped to an output-Parameter all other Properties are mapped to inputParameters.

This works really cool and is many times faster than ObjectContext.SaveChanges();

Question 1:

how do I declare a Devart.Data.Oracle.OracleParameter for output for
DbType.Int64???

var test = new Devart.Data.Oracle.OracleParameter();
test.DbType = DbType.Int64;

does internally set
test.DbType ==> to decimal!!

I have trouble with ExecuteArray() all OracleParameter array values with
ParameterDirection.Output getting an invalid cast exception because the
int64[] array value ist not compatible with decimal[] array value.

For input-direction it works fine... if I have set an int64[] as parameter value filled with all int64 keys.

But for output I have to write painful if else code to handle the difference for input and output direction and have to keep attention also during writing back the result array to real objects with int64 properties.

Question 2: Why do you not use RETURNING INTO clause for inserts???

During my research i have seen, Devart ?? or Microsoft EntityFramework??
uses cursor and select last inserted value for getting back StoreGeneratedIdentity and StoreGeneratedComputed values....
for each insert for each entity???

(I use RETURNING INTO clause for my mass insert and it works great!!)

Question 3: :wink: :wink:

Could Devart provide such a helpful extension supporting "all" internal hidden and dotfuscated features....
(I solved only the data types we use up to now....)
(Associations are also not supported up to now...)

Any advice or help available??

Thanks,

Roman
HCRoman
 
Posts: 55
Joined: Wed 12 Aug 2009 05:47

Postby AndreyR » Thu 24 Mar 2011 13:54

Thank you for the report and suggestions.
I have reproduced the problem with ExecuteArray; we are investigating the situation.
As for the suggestions, I recommend you to visit our Entity Framework support UserVoice.
Please vote for the existing suggestions and create your own.
We plan to add Batch Updates, for example.
AndreyR
Devart Team
 
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Postby AndreyR » Tue 05 Apr 2011 09:07

The problem with ExecuteArray is fixed in the upcoming build.
We plan to release the build in a week or so.
AndreyR
Devart Team
 
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Postby AndreyR » Thu 07 Apr 2011 13:07

The new build of dotConnect for Oracle 6.10.135 is available for download now. This build fixes the problem with ExecuteArray.
It can be downloaded from Download Page (trial version) or from Registered Users' Area (for users with valid subscription only).
For more information, please refer to this post.
AndreyR
Devart Team
 
Posts: 2919
Joined: Mon 07 Jul 2008 13:16


Return to dotConnect for Oracle