As a follow-up, I have successfully used a second IDalSession connection that has write permission that I open and close specifically when writing to the database and this works fine so there is a good workaround. However, I would prefer to use sp_setapprole if possible.

Garth Keesler wrote:
Being that I am somewhat paranoid about granting write access to users, when not using iBatisNet I make use of the "sp_setapprole" function in SQL Server 2005 to grant write access to the database connection temporarily. I then unset it immediately after the tx is complete. I've been wandering the iBatisNet code and have found references to the SQLConnection but the code implies that it is not meant to be public. Unfortunately, I get errors when attempting to use the IDalSession.Connection in the call to sp_setapprole. Given that, is there any way I can make use of sp_setapprole in iBatisNet to temporarily grant write access to the IDalSession database connection?

Thanx,
Garth

.


Reply via email to