Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please fix blocking exception with Devart Oracle provider #22

Closed
jonnybee opened this issue May 5, 2015 · 2 comments
Closed

Please fix blocking exception with Devart Oracle provider #22

jonnybee opened this issue May 5, 2015 · 2 comments

Comments

@jonnybee
Copy link

jonnybee commented May 5, 2015

Introduced with PR #17.

In my opinion one must always check if the property exists when using reflection. Now we will always get null-recerence exception when using AsyncPoco with Devart dotConnect for Oracle.

I can submit PR if you want.

Code should be:

public override void PreExecute(IDbCommand cmd)
{
    var bbnProperty = cmd.GetType().GetProperty("BindByName");
    if (bbnPropery != null)
    { 
        bbnProperty.SetValue(cmd, true, null);
    }
    //see http://docs.oracle.com/html/A96160_01/features.htm#1048395
    //if command does not have "InitialLONGFetchSize" property this code 
    // will not throw NullReferenceException
    var ilfsProperty = cmd.GetType().GetProperty("InitialLONGFetchSize");
    if (ilfsProperty != null)
    {
       ilfsProperty.SetValue(cmd, -1);
    }
}
@tmenier
Copy link
Owner

tmenier commented Aug 14, 2016

Apologies for not responding way back. It's getting fixed for 1.2.

@tmenier
Copy link
Owner

tmenier commented Aug 14, 2016

@tmenier tmenier closed this as completed Aug 14, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants