Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Component Services / September 2005

Tip: Looking for answers? Try searching our database.

release of serviced component on error

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Praveen - 16 Sep 2005 21:38 GMT
Hi All,
I have written a serviced componet and added to the com+..
When i call a function of this component the "Activated" count in the MMC
increases and comes down as expected but if there is an error in the
function call this object never gets deactivated. How do i make sure that
the object gets deactivated even if there is an error..

I am using windows 2003 server and dotnet framework 1.1

I am putting down the dotnet dll code structure. Please advise on how to get
this resolved...
Thanks in advance,
Praveen

using System;
using System.Runtime.InteropServices;
using Orchestra;
using System.EnterpriseServices;
using System.Threading;

namespace OrchFileServer
{

[InterfaceTypeAttribute( ComInterfaceType.InterfaceIsDual )]
[GuidAttribute("C190BFE1-54FC-471B-A7C4-9B6243297D47")]
public interface IFileTransfer
{
 void UploadFile(string strURL, string strFilePath);
}

[ EventTrackingEnabled( true ) ]
[ ObjectPooling( MinPoolSize = 10, MaxPoolSize = 100, CreationTimeout =
60000 ) ]
/// Specify COM+ Context Attributes
[ MustRunInClientContext( false ) ]
/// Enable JITA for the component
[ JustInTimeActivation( true ) ]
/// Enable Construction String Support for the component
[ ConstructionEnabled( Enabled=true, Default="" ) ]
/// Configure activity-based Synchronization for the component
[ Synchronization( SynchronizationOption.Required ) ]
/// Indicate the type of class interface that will be generated for this
class
[ ClassInterface( ClassInterfaceType.None ) ]

public class FileTransfer:ServicedComponent,IFileTransfer
{

 [ComVisible(true)]
 [ AutoComplete(true) ]
 public void UploadFile(string strURL, string strFilePath)
 {
  ContextUtil.DeactivateOnReturn = true;
  // function performs some operations....
 }

 protected override bool CanBePooled()
 {  // .. handle the CanBe Pooled message
  // The base implementation returns false
  return true;
 }
}
}
Robert Jordan - 16 Sep 2005 22:03 GMT
Hi!

> I have written a serviced componet and added to the com+..
> When i call a function of this component the "Activated" count in the MMC
> increases and comes down as expected but if there is an error in the
> function call this object never gets deactivated. How do i make sure that
> the object gets deactivated even if there is an error..

What kind of activation are you using? Server or library?

Rob
Praveen - 19 Sep 2005 17:49 GMT
I am using Server activation.

Regards,
Praveen

> Hi!
>
[quoted text clipped - 7 lines]
>
> Rob

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.