473,609 Members | 1,861 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Component will not create a new transaction

Gidday people,

I had a bit of a problem this morning. I think I've got it sorted now, but I
wonder if anyone can shed some light.

I have a plain VBS WHS file that instantiates a component that controls an
interface file import process. This component, Controller, is part of
FinInterface.dl l, and instantiates another component, Implementor (same
dll), that does the actual data access (an insert into a FinanceDataImpo rts
table, and then multiple inserts into a child FinanceData table).

All the data access logic is in the Implementor class so I set the
MTSTransactionM ode on this component to RequiresTransac tion and did all the
right things with ObjectContext. I left the MTSTransactionM ode set to
NotAnMTSObject for Controller class.

I created a new COM+ Services library application, configured *just* the
Controller class and thought I was away laughing.

To cut a long story short, during my testing I noticed that my transactions
weren't rolling-back (when I created error conditions). I tried heaps of
things, all the MTSTransactionM ode settings on the Implementor class,
switching from Library to Server applications, configured and unconfigured
modes, and every time I found that the Implementor class would not run in a
transaction. I verified this by inserting a call to
mObjectContext. IsInTransaction () and raising an error if it returned False -
which it did - every time.

I sorted it out by also setting the MTSTransactionM ode to
RequiresTransac tion on the Controller class, and installing *both*
Controller and Implementor in the COM+ Services library application. Even
though the Controller object doesn't use the ObjectContext specifically (it
never calls GetObjectContex t(), SetAbort(), SetComplete() or does any
database work), I guess the transaction is created when the first object
(Controller) is instantiated, and then it's used by the Implementor object.

I must admit this caught me a bit by surprise. I thought that any component
could get a reference to it's own ObjectContext regardless of how it's
instantiated. It looks like Implementor will only run in a transaction if
the calling component is configured as an MTS object, even if that first
object doesn't need a transaction.

Thanks for reading to the end. I hope I explained things well enough. Does
anyone have any thoughts on the behaviour here?

Cheers,

Alan
Jul 19 '05 #1
3 2572
do you use CreateObject to create objects?

you can't use New keyword and get the coclass creation interception COM+ is
doing. you have to go CreateObject (or CreateInstance) all the way through
COM libs.

New in VB is using a shortcut to create objects with a simple call to
object's constructor, jumping over all the COM (COM+) interception code.

HTH,
</wqw>
"Alan" <SP************ ******@inspire. net.nz> wrote in message
news:uk******** *****@TK2MSFTNG P12.phx.gbl...
Gidday people,

I had a bit of a problem this morning. I think I've got it sorted now, but I wonder if anyone can shed some light.

I have a plain VBS WHS file that instantiates a component that controls an
interface file import process. This component, Controller, is part of
FinInterface.dl l, and instantiates another component, Implementor (same
dll), that does the actual data access (an insert into a FinanceDataImpo rts table, and then multiple inserts into a child FinanceData table).

All the data access logic is in the Implementor class so I set the
MTSTransactionM ode on this component to RequiresTransac tion and did all the right things with ObjectContext. I left the MTSTransactionM ode set to
NotAnMTSObject for Controller class.

I created a new COM+ Services library application, configured *just* the
Controller class and thought I was away laughing.

To cut a long story short, during my testing I noticed that my transactions weren't rolling-back (when I created error conditions). I tried heaps of
things, all the MTSTransactionM ode settings on the Implementor class,
switching from Library to Server applications, configured and unconfigured
modes, and every time I found that the Implementor class would not run in a transaction. I verified this by inserting a call to
mObjectContext. IsInTransaction () and raising an error if it returned False - which it did - every time.

I sorted it out by also setting the MTSTransactionM ode to
RequiresTransac tion on the Controller class, and installing *both*
Controller and Implementor in the COM+ Services library application. Even
though the Controller object doesn't use the ObjectContext specifically (it never calls GetObjectContex t(), SetAbort(), SetComplete() or does any
database work), I guess the transaction is created when the first object
(Controller) is instantiated, and then it's used by the Implementor object.
I must admit this caught me a bit by surprise. I thought that any component could get a reference to it's own ObjectContext regardless of how it's
instantiated. It looks like Implementor will only run in a transaction if
the calling component is configured as an MTS object, even if that first
object doesn't need a transaction.

Thanks for reading to the end. I hope I explained things well enough. Does
anyone have any thoughts on the behaviour here?

Cheers,

Alan

Jul 19 '05 #2
The Controller object is instantiated using CreateObject in the WSH script,
and then instantiates the Implementor object using the New keyword. Should I
try changing the Controller class to CreateObject/CreateInstance the
Implementor object?

Thanks for the reply.

Alan

"Vlad Vissoultchev" <wq****@nospam. myrealbox.com> wrote in message
news:er******** ******@tk2msftn gp13.phx.gbl...
do you use CreateObject to create objects?

you can't use New keyword and get the coclass creation interception COM+ is doing. you have to go CreateObject (or CreateInstance) all the way through
COM libs.

New in VB is using a shortcut to create objects with a simple call to
object's constructor, jumping over all the COM (COM+) interception code.

HTH,
</wqw>
"Alan" <SP************ ******@inspire. net.nz> wrote in message
news:uk******** *****@TK2MSFTNG P12.phx.gbl...
Gidday people,

I had a bit of a problem this morning. I think I've got it sorted now, but
I
wonder if anyone can shed some light.

I have a plain VBS WHS file that instantiates a component that controls
an interface file import process. This component, Controller, is part of
FinInterface.dl l, and instantiates another component, Implementor (same
dll), that does the actual data access (an insert into a

FinanceDataImpo rts
table, and then multiple inserts into a child FinanceData table).

All the data access logic is in the Implementor class so I set the
MTSTransactionM ode on this component to RequiresTransac tion and did all

the
right things with ObjectContext. I left the MTSTransactionM ode set to
NotAnMTSObject for Controller class.

I created a new COM+ Services library application, configured *just* the
Controller class and thought I was away laughing.

To cut a long story short, during my testing I noticed that my

transactions
weren't rolling-back (when I created error conditions). I tried heaps of
things, all the MTSTransactionM ode settings on the Implementor class,
switching from Library to Server applications, configured and unconfigured modes, and every time I found that the Implementor class would not run in a
transaction. I verified this by inserting a call to
mObjectContext. IsInTransaction () and raising an error if it returned

False -
which it did - every time.

I sorted it out by also setting the MTSTransactionM ode to
RequiresTransac tion on the Controller class, and installing *both*
Controller and Implementor in the COM+ Services library application.

Even though the Controller object doesn't use the ObjectContext specifically

(it
never calls GetObjectContex t(), SetAbort(), SetComplete() or does any
database work), I guess the transaction is created when the first object
(Controller) is instantiated, and then it's used by the Implementor

object.

I must admit this caught me a bit by surprise. I thought that any

component
could get a reference to it's own ObjectContext regardless of how it's
instantiated. It looks like Implementor will only run in a transaction if the calling component is configured as an MTS object, even if that first
object doesn't need a transaction.

Thanks for reading to the end. I hope I explained things well enough. Does anyone have any thoughts on the behaviour here?

Cheers,

Alan


Jul 19 '05 #3
that's what i meant. this way Implementor reference you get will be
intercepted by COM+ and it's transaction settings will be honored. btw, your
Controller will actually get a "fake" proxy :-))

as far as i know WSH couldn't possibly use New because it's nonexistent in
VBScript.

cheers,
</wqw>

"Alan" <SP************ ******@inspire. net.nz> wrote in message
news:#e******** ******@TK2MSFTN GP12.phx.gbl...
The Controller object is instantiated using CreateObject in the WSH script, and then instantiates the Implementor object using the New keyword. Should I try changing the Controller class to CreateObject/CreateInstance the
Implementor object?

Thanks for the reply.

Alan

"Vlad Vissoultchev" <wq****@nospam. myrealbox.com> wrote in message
news:er******** ******@tk2msftn gp13.phx.gbl...
do you use CreateObject to create objects?

you can't use New keyword and get the coclass creation interception COM+ is
doing. you have to go CreateObject (or CreateInstance) all the way through
COM libs.

New in VB is using a shortcut to create objects with a simple call to
object's constructor, jumping over all the COM (COM+) interception code.

HTH,
</wqw>
"Alan" <SP************ ******@inspire. net.nz> wrote in message
news:uk******** *****@TK2MSFTNG P12.phx.gbl...
Gidday people,

I had a bit of a problem this morning. I think I've got it sorted now, but
I
wonder if anyone can shed some light.

I have a plain VBS WHS file that instantiates a component that controls an interface file import process. This component, Controller, is part of
FinInterface.dl l, and instantiates another component, Implementor
(same dll), that does the actual data access (an insert into a

FinanceDataImpo rts
table, and then multiple inserts into a child FinanceData table).

All the data access logic is in the Implementor class so I set the
MTSTransactionM ode on this component to RequiresTransac tion and did all the
right things with ObjectContext. I left the MTSTransactionM ode set to
NotAnMTSObject for Controller class.

I created a new COM+ Services library application, configured *just*
the Controller class and thought I was away laughing.

To cut a long story short, during my testing I noticed that my

transactions
weren't rolling-back (when I created error conditions). I tried heaps of things, all the MTSTransactionM ode settings on the Implementor class,
switching from Library to Server applications, configured and

unconfigured modes, and every time I found that the Implementor class would not run in
a
transaction. I verified this by inserting a call to
mObjectContext. IsInTransaction () and raising an error if it returned

False -
which it did - every time.

I sorted it out by also setting the MTSTransactionM ode to
RequiresTransac tion on the Controller class, and installing *both*
Controller and Implementor in the COM+ Services library application.

Even though the Controller object doesn't use the ObjectContext specifically (it
never calls GetObjectContex t(), SetAbort(), SetComplete() or does any
database work), I guess the transaction is created when the first
object (Controller) is instantiated, and then it's used by the Implementor

object.

I must admit this caught me a bit by surprise. I thought that any

component
could get a reference to it's own ObjectContext regardless of how it's
instantiated. It looks like Implementor will only run in a transaction

if the calling component is configured as an MTS object, even if that first object doesn't need a transaction.

Thanks for reading to the end. I hope I explained things well enough. Does anyone have any thoughts on the behaviour here?

Cheers,

Alan



Jul 19 '05 #4

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

Similar topics

0
1225
by: David Morgan | last post by:
Hello All Back in the day, when I was up to my elbows in Site Server 3 Commerce Edition, there was a SMTP Component that supported transactions. If the mail could not be delivered the transaction would abort. This was extremely useful because it meant that if part of your order processing required an email to be sent, (delivered), if it could not be, the whole order placement process would roll back. Just wondering if anyone knows...
0
1207
by: Steve Jorgensen | last post by:
I'm posting a link here because I'm hoping it will be as enlightening to other Access developers as it has been to me. http://citeseer.ist.psu.edu/cache/papers/cs/15952/http:zSzzSzwww.trireme.comzSzcatalysiszSzfworksPaper.pdf/frameworks-and-component-based.pdf Having been a database application developer for a long time, I have now realized that the SQL bias tends to leads to an excessively white-boxed thinking about applications. A...
8
4358
by: Don Riesbeck Jr. | last post by:
I have an C# EnterpriseService component that is part of an application I am developing that is responsible for writing data to an SQL Server. (it reads from a local DB (MSDE), then writes to a 'remote' DB (SQL Server 2k)...) On some machines I get the following exception: System.InvalidOperationException: An error occurred while enlisting in a distributed transaction. at...
11
3258
by: Hazz | last post by:
is there something as easy as just providing a link to an inexpensive credit card approval/payment component to integrate into an asp.net app. My question isn't about the linking process itself but rather about my wanting a very simple but robust credit card transaction component that I would not have to build myself. I already have a navigation system to display product. thank you -greg
7
2571
by: Alan Silver | last post by:
Hello, I've just been looking at the free PayPal component from ComponentOne and am somewhat amazed how insecure it is. They include all the transaction details in plain text in the querystring, meaning that any rank novice can click the Buy button on your site, then when the PayPal page loads, change the amount for the transaction and press Enter. This reloads the page with the new amount. This is so obvious that anyone could do it.
3
1561
by: gabe | last post by:
I have a general design question. What's a 'Best Practice' for middle tier component design? I'm thinking of a web form that contains data from multiple tables. The data is supplied from one or more muti-table joins. Is it better to populate a form by binding to dataset tables or load the data in collection classes? How are the updates handled? Would there be a stored procedure for each table that is updated, and have all the updates...
5
1621
by: Stuart Dee | last post by:
Hi, I have created a com+ component with vb dot net using jit activation and transactions If i call it like this x=createobject("mycomp") x.dispose
0
1810
by: Pieter | last post by:
Hi, When using clickOnce for a VB.NET 2.0 application it installs fine on every computer, except one (a new one...). Every is isstalled, Framework, Mdac, .... The error in the log file is: "External component has thrown an exception" Does anybody knows what could have caused this problem?
0
5341
by: bharathreddy | last post by:
In .Net COM+ components are referred to as serviced components, Namespace: System.EnterpriseServices; Advantage of Serviced Components: object pooling, database connection pooling,
0
8573
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8222
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8406
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6057
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5510
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4085
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2531
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1672
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1389
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.