"MP" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
Hi,
1) We call this method from Asp.net in the folowing manner.
This is the Save method inside our business object that calls the
previously posted code:
public void Save() {
using(TransactionScope scope = new TransactionScope()) {
using(SqlConnection cn = new
SqlConnection(DatabaseConnection.MyConnection)) {
cn.Open();
if(this.IsDeleted) {
//do db delete work
}
else {
if(this.IsNew) {
//do db insert work
}
else {
//do db update work
}
if(this.IsNew) {
mEventId =
(int)cm.Parameters["@eventId"].Value; //if this was an insert get the
id
bool isFolderCreated =
EmailFolderCreator.CreateEventEmailFolder(mEventId);
if(isFolderCreated == false) {
throw new
BusinessLayerException(ResourceStrings.GetResourceString("EmailFolderNotCreated"));
}
}
}
}
scope.Complete();
}
}
2) For releasing the interface i am not sure what you mean by, Can
please clear a bit more on this point. I believe right now we are not
releasing the interface.
3) I belive this is a server application. For more details you can
refer to following links
http://www.15seconds.com/issue/030930.htm
Oh I see, you are using COM+ services without Components, a COM+ 1.5 feature which allows
you to get (some) COM+ services without deriving from ComponentServices. Such components do
run "in-process", that means they run in the security context of the caller, so here the
caller is allowed to call LogonUser() (which I suppose you do in your Impersonate method)
and the CreateEventEmailFolder Method doesn't need distributed transaction services either.
I suggest you to drop this ServiceDomain completely and make it a simple "regular" method
that only impersonates in order to create/delete a folder.
Willy.