You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-cs@ibatis.apache.org by Garth Keesler <ga...@gdcjk.com> on 2007/02/25 15:51:26 UTC

sp_setapprole

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

Re: sp_setapprole

Posted by Garth Keesler <ga...@gdcjk.com>.
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
>
> .
>