Fw: begin work without replication in .NET
Posted in 2005
Hi All, Here is a using Informix .NET provider code snippet that creates transaction in the application. String ConnStr = "server=ids; database=mydb;"; IfxConnection Conn = new IfxConnection( ConnStr ); Conn.Open(); IfxTransaction Txn = Conn.BeginTransaction(); IfxCommand Cmd = new IfxCommand( SQL, Conn, Txn ); //Do the SQL operation with the Command Object Cmd //Then Call Commit or Rollback if ( x == y ) Txn.Commit(); else Txn.Rollback(); Conn.Close(); Regards, Satyan Software Engineer R&D - IBM Information Management Division 11200 Lakeview, Lenexa, KS 66219 Tel: 913 599 8792 (T/L: 337-8792) ----- Forwarded by Venkatesh Gopal/Lenexa/IBM on 12/15/2005 05:06 PM ----- |---------+----------------------------> | | "Madison Pruet" | | | <mpruet@comcast.n| | | et> | | | Sent by: | | | owner-informix-li| | | st@iiug.org | | | | | | | | | 12/15/2005 02:19 | | | PM | | | Please respond to| | | "Madison Pruet" | |---------+----------------------------> >------------------------------------------------------------------------------------------------------------------------------| | | | To: informix-list@iiug.org | | cc: | | Subject: Re: begin work without replication in .NET | >------------------------------------------------------------------------------------------------------------------------------| I've contacted the .NET guys on this issue. "DL Redden" <redden96@yahoo.com> wrote in message news:dnseup$fa6$1@news.xmission.com... > > Jonathan, thanks for the reply. > > I admittedly have not tried anything yet so I will attempt the approach > you've outlined below. I cannot think of anything else that would work > so I hope that the functionality exists for me to work around it. > > I was hoping that someone from IBM who is involved in ER and .NET would > have thought about this already and found a work around since there is > no built in feature for this type of transaction in the .NET provider. > > I suppose that if the .NET provider won't let me do this the OLEDB > provider might. That would give me an acceptable solution. I do so wish > that our company standard was PERL instead of .NET. :( > > --- Jonathan Leffler <jleffler@earthlink.net> wrote: > > > DL Redden wrote: > > > Is there a way to create a transaction using the > > > Informix .NET provider that emulates the BEGIN WORK > > > WITHOUT REPLICATION syntax? > > > > > > I cannot find anything in the doc about this. > > > > Pure guesswork... > > > > Make sure AutoCommit (if such exists - it likely does) is off. > > > > Run a singleton statement - equivalent of EXECUTE IMMEDIATE that says > > > > 'BEGIN WORK WITHOUT REPLICATION'. If the normal commit/rollback > > methods > > won't work (because they are unaware that a TX was started), run > > singleton statements to do 'COMMIT' or 'ROLLBACK'. > > > > Remember - that was a guess (semi-educated, but still a guess). > > > > -- > > Jonathan Leffler #include <disclaimer.h> > > Email: jleffler@earthlink.net, jleffler@us.ibm.com > > Guardian of DBD::Informix v2005.02 -- http://dbi.perl.org/ > sending to informix-list [demime 1.01d removed an attachment of type image/gif which had a name of ecblank.gif] [demime 1.01d removed an attachment of type image/gif which had a name of pic00406.gif] sending to informix-list