473,378 Members | 1,401 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Cusom exceptions and COM+

I am having problems with custom exceptions in COM+, I have read the article
in MSDN (march 2004) and implemented the correct features....

The custom exception class derives of ApplicationException and also has the
[Serializeable] attribute and has a
Serialization constructor and overriden implementation of GetObjectData....

[Serializable]
public class BaseException : System.ApplicationException,
ISerializable......
The COM+ component is used in an object pool and has the following
attrbitues

[Transaction(TransactionOption.Required,
Isolation=TransactionIsolationLevel.Serializable, Timeout=60)]
[ObjectPooling(Enabled=true, MinPoolSize=2, MaxPoolSize=20,
CreationTimeout=30)]
[ClassInterface(ClassInterfaceType.AutoDual)]
[EventTrackingEnabled (true)]
public class XXXX : ServicedComponent, IXXXX.....

Where IXXXX is the public interface.

Can anyone tell me why I am still only get System.Exception on the client
side of the COM+ boundary and not my custom exception

Cheers in advance

Ollie
Nov 16 '05 #1
3 1815
Ollie,

Custom exceptions being thrown from a serviced component are an ugly
thing. Check out the article in MSDN titled "Throwing Custom Exception
Types from a Managed COM+ Server Application", located at (watch for line
wrap):

http://msdn.microsoft.com/msdnmag/is...M/default.aspx

It will explain the issues involved.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Ollie" <ol**********@hotmail.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
I am having problems with custom exceptions in COM+, I have read the article in MSDN (march 2004) and implemented the correct features....

The custom exception class derives of ApplicationException and also has the [Serializeable] attribute and has a
Serialization constructor and overriden implementation of GetObjectData....
[Serializable]
public class BaseException : System.ApplicationException,
ISerializable......
The COM+ component is used in an object pool and has the following
attrbitues

[Transaction(TransactionOption.Required,
Isolation=TransactionIsolationLevel.Serializable, Timeout=60)]
[ObjectPooling(Enabled=true, MinPoolSize=2, MaxPoolSize=20,
CreationTimeout=30)]
[ClassInterface(ClassInterfaceType.AutoDual)]
[EventTrackingEnabled (true)]
public class XXXX : ServicedComponent, IXXXX.....

Where IXXXX is the public interface.

Can anyone tell me why I am still only get System.Exception on the client
side of the COM+ boundary and not my custom exception

Cheers in advance

Ollie

Nov 16 '05 #2
Cheers for the reply Nick, I have re-read the article and now see my
mistake, but from your comment do you think passing custom exceptions from
serviced components should be discouraged?

Cheers

Ollie

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:Oy**************@TK2MSFTNGP10.phx.gbl...
Ollie,

Custom exceptions being thrown from a serviced component are an ugly
thing. Check out the article in MSDN titled "Throwing Custom Exception
Types from a Managed COM+ Server Application", located at (watch for line
wrap):

http://msdn.microsoft.com/msdnmag/is...M/default.aspx
It will explain the issues involved.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Ollie" <ol**********@hotmail.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
I am having problems with custom exceptions in COM+, I have read the

article
in MSDN (march 2004) and implemented the correct features....

The custom exception class derives of ApplicationException and also has

the
[Serializeable] attribute and has a
Serialization constructor and overriden implementation of

GetObjectData....

[Serializable]
public class BaseException : System.ApplicationException,
ISerializable......
The COM+ component is used in an object pool and has the following
attrbitues

[Transaction(TransactionOption.Required,
Isolation=TransactionIsolationLevel.Serializable, Timeout=60)]
[ObjectPooling(Enabled=true, MinPoolSize=2, MaxPoolSize=20,
CreationTimeout=30)]
[ClassInterface(ClassInterfaceType.AutoDual)]
[EventTrackingEnabled (true)]
public class XXXX : ServicedComponent, IXXXX.....

Where IXXXX is the public interface.

Can anyone tell me why I am still only get System.Exception on the client side of the COM+ boundary and not my custom exception

Cheers in advance

Ollie


Nov 16 '05 #3
Ollie,

I don't think that it should be discouraged, not at all. It's just a
pain, given the differences between the exception system of .NET and the
HRESULT-based error system of COM/COM+.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Ollie" <ol**********@hotmail.com> wrote in message
news:u6**************@tk2msftngp13.phx.gbl...
Cheers for the reply Nick, I have re-read the article and now see my
mistake, but from your comment do you think passing custom exceptions from
serviced components should be discouraged?

Cheers

Ollie

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in message news:Oy**************@TK2MSFTNGP10.phx.gbl...
Ollie,

Custom exceptions being thrown from a serviced component are an ugly
thing. Check out the article in MSDN titled "Throwing Custom Exception
Types from a Managed COM+ Server Application", located at (watch for line
wrap):

http://msdn.microsoft.com/msdnmag/is...M/default.aspx

It will explain the issues involved.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Ollie" <ol**********@hotmail.com> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
I am having problems with custom exceptions in COM+, I have read the

article
in MSDN (march 2004) and implemented the correct features....

The custom exception class derives of ApplicationException and also
has the
[Serializeable] attribute and has a
Serialization constructor and overriden implementation of

GetObjectData....

[Serializable]
public class BaseException : System.ApplicationException,
ISerializable......
The COM+ component is used in an object pool and has the following
attrbitues

[Transaction(TransactionOption.Required,
Isolation=TransactionIsolationLevel.Serializable, Timeout=60)]
[ObjectPooling(Enabled=true, MinPoolSize=2, MaxPoolSize=20,
CreationTimeout=30)]
[ClassInterface(ClassInterfaceType.AutoDual)]
[EventTrackingEnabled (true)]
public class XXXX : ServicedComponent, IXXXX.....

Where IXXXX is the public interface.

Can anyone tell me why I am still only get System.Exception on the

client side of the COM+ boundary and not my custom exception

Cheers in advance

Ollie



Nov 16 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

16
by: David Turner | last post by:
Hi all I noticed something interesting while testing some RAII concepts ported from C++ in Python. I haven't managed to find any information about it on the web, hence this post. The problem...
21
by: dkcpub | last post by:
I'm very new to Python, but I couldn't find anything in the docs or faq about this. And I fished around in the IDLE menus but didn't see anything. Is there a tool that can determine all the...
26
by: OvErboRed | last post by:
I just read a whole bunch of threads on microsoft.public.dotnet.* regarding checked exceptions (the longest-running of which seems to be <cJQQ9.4419 $j94.834878@news02.tsnz.net>. My personal...
22
by: Drew | last post by:
How do I know which exceptions are thrown by certain methods? For example, reading a file might throw an IO Exception, etc. In Java, the compiler won't even let you compile unless you put your...
0
by: Ollie | last post by:
I am having problems with custom exceptions in COM+, I have read the article in MSDN (march 2004) and implemented the correct features.... The custom exception class derives of...
14
by: dcassar | last post by:
I have had a lively discussion with some coworkers and decided to get some general feedback on an issue that I could find very little guidance on. Why is it considered bad practice to define a...
1
by: Anonieko | last post by:
Understanding and Using Exceptions (this is a really long post...only read it if you (a) don't know what try/catch is OR (b) actually write catch(Exception ex) or catch{ }) The first thing I...
2
by: Zytan | last post by:
I know that WebRequest.GetResponse can throw WebException from internet tutorials. However in the MSDN docs: http://msdn2.microsoft.com/en-us/library/system.net.webrequest.getresponse.aspx It...
0
RedSon
by: RedSon | last post by:
Chapter 3: What are the most common Exceptions and what do they mean? As we saw in the last chapter, there isn't only the standard Exception, but you also get special exceptions like...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.