[Mono-list] Web Services asynchronously
Luciano _
lnc19 at hotmail.com
Wed Jun 11 11:52:02 EDT 2008
Hi:
Right, i didn't think that, but i was viewing the MySql Connector source code, and it actually do Nothing the Transaction finalizer (Dispose), i will use Using statement, but, probably is "Always"? :)If i call Abort() on the Gtk app, the services keep running but i lost the references or WS receipt some type of "Abort Signal" and really abort the operation? when i get the "WebException" Exception, it is already aborted and rolled back? (Rolled back of course, if i call the abort, and the Transaction wasn't commited already)
Thanks
> Date: Wed, 11 Jun 2008 17:24:46 +0200> From: rook at roo.k.pl> To: lnc19 at hotmail.com> CC: mono-list at lists.ximian.com> Subject: Re: [Mono-list] Web Services asynchronously> > Hi!> > Most probably the transaction will be rolled back when myTran will be > finalized.> You should wrap myTrans, cmd, cmd2, etc with "using" so as not to be > dependent on the finalizer.> > Cheers!> Michał Ziemski> > Luciano _ pisze:> > Hi:> > I have a question about the Web Services, and how it works on mono.> > > > I have a WebServices (running in apache with mod_mono) that use > > MySqlConnector to connect mysql server on the same machine. Within > > this WS i make some operations (Insert's and update's) in a > > transaction operation.> >> > I'm consuming this WS with a GtkSharp app, this app calls the WS > > asynchronously, with CallBack.> > My Question is, if the services is aborted in the middle of the > > transaction, the transaction will be rolled back? Or not? I test it, > > and i think yes, but i need to know if always be rolled back, or maybe > > sometimes no. My doubt is that maybe if the operation has terminated > > the transaction but the services is not finished and services is > > aborted, the services will be aborted but the transaction will be > > commited. Is the connection (i use a Using statement) correctly disposed?> > > > The WS method (pseudo-code) will be like this:> >> > [WebMethod()]> > public void TestAsync()> > {> > using(MySqlConnection conn = new > > MySqlConnection("....ConnectionString..."))> > {> > conn.Open();> > MySqlTransaction myTran = conn.BeginTransaction();> > > > MySqlCommand cmd = new mySqlCommand();> > cmd.Transaction = myTran;> > cmd.CommandText = "INSERT INTO SOME TABLE;"> > cmd.ExecuteNonQuery();> > > > // If the abort call is in this moment, the transaction > > is rolled back? The connection is correctly disposed and closed?> > > > MySqlCommand cmd2 = new mySqlCommand();> > cmd2.Transaction = myTran;> > cmd2.CommandText = "UPDATE SOME TABLE;"> > cmd2.ExecuteNonQuery();> > > > // If the abort call is at this moment the transaction is > > rolled back?> > myTran.Commit();> > > > // If the abort call is at this moment the transaction is > > NOT rolled back?> > conn.Close();> > }> > // The Using Statement is executing the Dispose method if i call > > Abort() ?> > > > }> > > > > > Thanks a lot in advanced, i will really appreciate help.> >> > Luciano> >> > ------------------------------------------------------------------------> > Stop squinting -- view your photos on your TV. Learn more > > <http://www.microsoft.com/windows/digitallife/default.mspx?deepLink=photos> > >> > ------------------------------------------------------------------------> >> > _______________________________________________> > Mono-list maillist - Mono-list at lists.ximian.com> > http://lists.ximian.com/mailman/listinfo/mono-list> > > > _______________________________________________> Mono-list maillist - Mono-list at lists.ximian.com> http://lists.ximian.com/mailman/listinfo/mono-list
_________________________________________________________________
Get your fix of news, sports, entertainment and more on MSN Mobile
http://www.msnmobilefix.com/Default.aspx
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-list/attachments/20080611/886901ce/attachment.html
More information about the Mono-list
mailing list