|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
Re: .NET Serviced Components, Oracle and overall Design question
From: Nick Robinson (nicholasrobinson
YAHOO.CO.UK)
Date: Thu Jan 15 2004 - 13:57:51 CST
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
OK I think I see your point. The .NET Serviced Component in this case, is
the first point of call, and any invokation on any method on the class being
used by the client (and the client is irrelevant), will start the logical
transaction. I say the client is irrelevant because I know the client isnt
some other component that could also be in a transaction when it calls into
my component. Likewise, my component in that scenario wouldnt be the root
transaction.
When you say component, it is interesting. In my scenario, I only have one
component but two other classes from two different assemblies, none of these
two classes are ServicedComponent descendants. Since the classes will be
invoked in-proc, and bound as in a normal method invokation on a canonical
class, the two classes will automatically become part of the Context, and
thus be part of the logical transaction. If these were components, I would
need to mark them as supporting a transaction. However in the design I
mentioned, there is only one transaction, assigned to the
application/controller layer.
The problem has been solved however. It seems using the latest version of
Oracle and ODP.NET with the Oracle MTS services, Proxy Authentication is not
supported. In my situation, this is the security design we have been forced
to comply with. Apparently the OracleMTS COM+ services fails to access the
relevant security details, when using Proxy Authentication, requiring a
persons password to be exposed on the connection string, which obviates the
need for PA in the first place. So, when the method call returns and
everything *is* ok, the Oracles MTS/COM+ services fail to work correctly,
and everything bombs out as we get the error "The root transaction wanted to
commit, but transaction aborted".
Incidentally, in the situation were this problem arose, the client was a
simple test case running under NUnit.
nick.robinson
site : www.fromconcept.co.uk
blog : www.fromconcept.co.uk/weblog.aspx
> -----Original Message-----
> From: Distributed COM-Based Code [mailto:DCOM
DISCUSS.MICROSOFT.COM]On
> Behalf Of Katiyar, Subodh (Path)
> Sent: 15 January 2004 11:41
> To: DCOM
DISCUSS.MICROSOFT.COM
> Subject: Re: .NET Serviced Components, Oracle and overall Design
> question
>
>
> i mean it happens if some of the componet are not marked as
> transaction in between
> like if asp is calling the vb.net compoent and the it is not
> marked properly for the transaction this happens.
> what is your client is it some application or aspx.
> and mark assembly as uses transaction
> for this is the one which actually need to do the work.
> you marked the wrapper for the transaction but the transdaction
> is having no idea of the actual worker.
> like in simple vb it is same difference as
> objectcontext.createinstance and createobject
> your transaction is not being linked properly,
> this happened to me too,
> but in mycase the middle component was not marked for the
> transaction where as the outer one was marked.
> and there was no begin trans and commit trans while calling the proc.
>
>
> -----Original Message-----
> From: Nick Robinson [mailto:nicholasrobinson
YAHOO.CO.UK]
> Sent: Thursday, January 15, 2004 5:07 Shaam
> To: DCOM
DISCUSS.MICROSOFT.COM
> Subject: Re: .NET Serviced Components, Oracle and overall Design
> question
>
>
> I am not sure what you mean.
>
> --- "Katiyar, Subodh (Path)" <skatiyar
AFSINDIA.COM> wrote: > Hi,
> >
> > throw some exception in the phase II object that has called for
> > rollback.
> >
> > Best Regards,
> >
> > -----Original Message-----
> > From: Nick Robinson [mailto:nicholasrobinson
YAHOO.CO.UK]
> > Sent: Thursday, January 15, 2004 3:19 Shaam
> > To: DCOM
DISCUSS.MICROSOFT.COM
> > Subject: .NET Serviced Components, Oracle and overall Design question
> >
> >
> > I am not sure this is the right place to post this, so please
> accept my apologies if I am wrong
> > for writing here.
> >
> > I have created a single, .NET Serviced Component. The
> component requires a transaction, and has
> > a
> > single method, called Insert.
> >
> > [AutoComplete]
> > public void Insert(Somedata)
> > {
> > DBRepository dbRepository = new DBRepository();
> > dbRepository.Insert(Somedata);
> > }
> >
> > DBRepository is a vanilla C# class created in a different
> assembly to the serviced component.
> > The
> > repository also uses a DAL type assembly which contains
> structures and classes for accessing
> > stored procedures in an Oracle database. In the above example,
> the sequence diagram looks like:
> >
> > Assembly A Assembly B Assembly C
> > Client ServicedComponent DBRepository StoredProc
> >
> > Insert(data)
> > --------------------> <<create>>
> > --------------------> <<create>>
> > -------------------->
> >
> > Insert(data)
> > --------------------->
> > SetParams(...)
> > ------------------->
> >
> > ExecuteNonQuery()
> > ------------------->
> > <--------------------
> >
> > In a test application, I managed to get the above working 100%.
> When exceptions occur during
> > the
> > method call to the serviced component, the transaction is
> rolled back, even though the
> > repository
> > and stored procedure classes are not .NET serviced components.
> >
> > After getting the test harness to work, I introduced the .NET
> Serviced Component design to a
> > real
> > system, which has a similar call chain to above. However in
> this scenario, I get the following
> > error:
> >
> > "The root transaction wanted to commit, but transaction aborted".
> >
> > I am using Oracle 9.2.0.4 with the latest version of ODP.NET.
> This error occurs immediately
> > after
> > the method returns, so I dont think the error is due to a DTC timeout.
> >
> > Any advice on this would be most welcome.
> >
> > Thanks in advance.
> >
> >
> >
> > =====
> > nick.robinson
> > site : www.fromconcept.co.uk
> > blog : www.fromconcept.co.uk/weblog.aspx
> >
> > ________________________________________________________________________
> > Yahoo! Messenger - Communicate instantly..."Ping"
> > your friends today! Download Messenger Now
> > http://uk.messenger.yahoo.com/download/index.html
> >
> > ----------------------------------------------------------------
> > Users Guide http://discuss.microsoft.com/archives/mailfaq.html
> > contains important info. Save time, search the archives at
> > http://discuss.microsoft.com/archives/index.html .
> > To unsubscribe, mailto:DCOM-signoff-request
DISCUSS.MICROSOFT.COM
> >
> >
> > DISCLAIMER:
> > The information contained in this Message is confidential and
> intended only for the use of the
> > individual or entity identified. If the reader of this message
> is not the intended recipient,
> > any dissemination, distribution or copying of the information
> contained in this message is
> > strictly prohibited. If you received this message in error,
> please notify the sender
> > immediately.
> >
> > ----------------------------------------------------------------
> > Users Guide http://discuss.microsoft.com/archives/mailfaq.html
> > contains important info. Save time, search the archives at
> > http://discuss.microsoft.com/archives/index.html .
> > To unsubscribe, mailto:DCOM-signoff-request
DISCUSS.MICROSOFT.COM
>
> =====
> nick.robinson
> site : www.fromconcept.co.uk
> blog : www.fromconcept.co.uk/weblog.aspx
>
> ________________________________________________________________________
> Yahoo! Messenger - Communicate instantly..."Ping"
> your friends today! Download Messenger Now
> http://uk.messenger.yahoo.com/download/index.html
>
> ----------------------------------------------------------------
> Users Guide http://discuss.microsoft.com/archives/mailfaq.html
> contains important info. Save time, search the archives at
> http://discuss.microsoft.com/archives/index.html .
> To unsubscribe, mailto:DCOM-signoff-request
DISCUSS.MICROSOFT.COM
>
>
> DISCLAIMER:
> The information contained in this Message is confidential and
> intended only for the use of the individual or entity identified.
> If the reader of this message is not the intended recipient, any
> dissemination, distribution or copying of the information
> contained in this message is strictly prohibited. If you received
> this message in error, please notify the sender immediately.
>
> ----------------------------------------------------------------
> Users Guide http://discuss.microsoft.com/archives/mailfaq.html
> contains important info. Save time, search the archives at
> http://discuss.microsoft.com/archives/index.html .
> To unsubscribe, mailto:DCOM-signoff-request
DISCUSS.MICROSOFT.COM
----------------------------------------------------------------
Users Guide http://discuss.microsoft.com/archives/mailfaq.html
contains important info. Save time, search the archives at
http://discuss.microsoft.com/archives/index.html .
To unsubscribe, mailto:DCOM-signoff-request
DISCUSS.MICROSOFT.COM
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]