[Solved] WCF, MySQL and Transaction


This can’t be the code that’s causing an issue. The error you are getting is coming from an attempt to return or pass in a MySqlTransaction to/from the service. That’s just simply not going to work.

Also, why on earth are you exposing a Command object to the outside world via a public property? Furthermore, it doesn’t even appear that you use it… Delete that property and keep your command scoped to the method that uses it. If you don’t and you run this service as a singleton, you’ll get lots of crazy bugs.

Even furthermore… This is an extremely dangerous service to expose. If you were to have someone use it other than yourself, it provides zero encapsulation. Heck, you might as well just open up a port directly to the SQL Server, as dumb as that sounds.

5

solved WCF, MySQL and Transaction