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

Error connect database #8

Open
ghost opened this issue Jul 5, 2017 · 3 comments
Open

Error connect database #8

ghost opened this issue Jul 5, 2017 · 3 comments

Comments

@ghost
Copy link

ghost commented Jul 5, 2017

When create connection to database, program show error

System.TypeLoadException: 'Method 'ExecutePreparedQuery' in type 'OrientDB.Net.ConnectionProtocols.Binary.Core.OrientDBBinaryConnection' from assembly 'OrientDB.Net.ConnectionProtocols.Binary, Version=0.1.12.0, Culture=neutral, PublicKeyToken=null' does not have an implementation.'

https://ibb.co/fy9h9a

@realityenigma
Copy link
Contributor

Prepared Queries are currently a work in-progress, as a result, they are not completely operational.

@weizensnake
Copy link

weizensnake commented Jul 31, 2017

So how is one supposed to get around this problem for the moment? The issue is not that we want to use prepared queries but rather that the binary protocol, which is the only one available, does not implement IOrientDatabaseConnection. There seems to be no way to get a version of Core+Protocol+Serializer that can even connect to a database.

@weizensnake
Copy link

If anyone runs into this problem here is how I managed to at least get Core + Binary Protocol + CSV serializer to work to the point where I can connect to a database. Any input from more knowledgeable people would be greatly appreciated because what I did here doesn't quite feel as if it's by the book.

The problem is that BinaryProtocol 0.1.12 (the latest at the moment) does not implement IOrientDatabaseConnection.ExecutePreparedQuery(). If you look at binary protocol it wants Core 0.1.11. But downgrading to that isn't possible because the CSV serializer wants Core >= 0.1.16.

  1. I pulled the binary protocol project and added a dummy implementation for the missing method (it just throws a NotImplementedException).
  2. Upgrade the binary protocol to OrientDB.Net.Core 0.1.16. That's impossible out of the box because that version of core targets NetStandard1.6 while the binary protocol targets both CoreApp1.0 and NetFramework4.5.1, the latter being incompatible with NetStandard1.6. Sigh. To get around that, unload the binary protocol project in VS, then edit its csproj file to target NetStandard1.6 (I'm sure we could also just target, say, CoreApp1.1. but this worked for me).
    After that compilation will fail: in OrientDBNetworkConnection.Dispose() you need to make sure to call _socket.Dispose() so you either have to fix that #if clause or just comment the whole clause out and only call _socket.Dispose().
  3. Now rebuild the binary protocol
  4. Go into your client project and reference your own assembly of binary protocol and get OrientDB.Net.Core 0.1.16 and the latest CSV serializer.

That should be it. I would be glad to help updating the BinaryProtocol project but it's hard to see what the roadmap there is and how one could contribute.

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