markrendle / Simple.Data

A light-weight, dynamic data access component for C# 4.0
MIT License
1.33k stars 302 forks source link

Fix stored proc resolution for non-dbo schema #341

Closed ShamsulAmry closed 10 years ago

ShamsulAmry commented 10 years ago

I was actually facing trouble to properly use stored proc. In a transaction, I found out that the active transaction is not assigned to the stored proc SqlCommand object if I explicitly specify the schema of the stored proc.

The active transaction will be properly assigned if I did not explicitly specify the schema, however this will only work when the schema of the stored proc is dbo.

The options I had, sorted by most preferred to least preferred:

  1. Properly assign the active transaction when the schema is explicitly stated - did not figure out how to do this
  2. Stored proc lookup should work across all schema when no schema is specified - included in this pull request
  3. Change the schema of my stored proc to dbo - pretty much unacceptable
richardhopton commented 10 years ago

Did you not want this merged?

markrendle commented 10 years ago

I think it would be better to fix the transaction issue, this change might result in some unexpected behaviour for other users.

ShamsulAmry commented 10 years ago

Sorry. I closed this on my own because of the same reason Mark stated. And just noticed the replies a bit too late.