I meant to say that only solution come to my mind is to pass DB parameter to function which is not possible. I want some other way in which this can be implemented.
paresh_joe
Posts
-
How this can be done in Atomic way? -
How this can be done in Atomic way?Class A { B bsObject; public void FunctionOfClassA() { bsObject.FunctionOfClassB() } } Class B { public void FunctionOfClassB() { } } I have my program structure as shown above. I want a way to apply atomicity to this. I mean if Class B's data write worked fine but Class A's calculations failed then want to rollback the data write. i want it all succeed or rollback. One way i can think of is to create a DB ptr and begin transaction just before call to FunctionOfClassB() and pass it as a parameter. so in this FunctionOfClassB will use same db ptr to write data. And it would also be possible in FunctionOfClassA() to check if calculations went ok then commit or rollback. My requirement is to not to make any change in parameter list or not to provide a new method with new parameter. Class A { B bsObject; public void FunctionOfClassA() { bsObject.FunctionOfClassB() // some calculations // Here I want to decide whether to commit or rollback } } Class B { public void FunctionOfClassB() { // here i want to begin a transaction // some data writing. } } Can anyone give an high level summary how this could be possible?
-
Would this allow Employee and Member both? -
is it possible to handle two transaction using DTC?I am interested in knowing whether it is possible to coordinate two database transaction using Distributed Transaction Coordinator (MSDTC). Any reference would be good. Thanks, Perry :)
-
IXMLDOMSchemaCollection raw_add(,) fails?I am writing program to validate xml with schema. but it fails when schemaColl.raw_add(_bstr_t(),_variant_t(L"XSDFileName.xsd")) is called. I don't find any way to get detail errors. Has anybody know about why it could fail? is it the case that path related (xsd file's path) problem? Thanks, Perry
-
Is it good practice to use TRY-CATCH in this way?I am writing block which throws com exception and i have written code in following way. GetDate() & SetDate(d) both throws exception. Date d; try { // Many statements can throws exception d = GetDate(); SetDate(somedate); // calculate some "value" } catch(_com_exception &) { // set value = 0; } try { SetDate(d); // reset date } catch(_com_exception &) { // set value = 0; } Even if both block throws same exception i cant put them in one try for the reason that in any case either it throws exception or not i want to reset date at the end. Is this code looks good with consideration of good coding practices? Thanks, Perry
-
Any way to log on to a web page ?I want to write C# application that will log on to web page with provided user name and password. Any hint on this! Thanks, Perry
-
Read Webpage that first requires to put in User/PasswordNo success with this too :( ...
-
Read Webpage that first requires to put in User/PasswordI tried setting Credentials with my user and password :( .. still it reads login page ...
-
Read Webpage that first requires to put in User/PasswordI am writing one simple C# application; which is used to read contents of web page. While reading from the URL which first requires to log in. Is there anyway that i can set user and password, and can read data from this page. Thanks, Perry
-
Why not to use Smart types in a container?Thanks for the answer. but my other question is e.g. what care needs to be taken if i use _bstr_t in a vector?
-
Why not to use Smart types in a container?Any extra things that one has to consider while using this?
-
Why not to use Smart types in a container?Some coding standards at my end says that, Do not use smart types in a container? Does anyone know reason for this?
-
Error:The request failed with HTTP status 400: Bad RequestHi, Even i am getting same kind of error .. but no one has replied yet :(
-
HTTP status 400: Bad Requesti have already checked ... ;P i am posting here as none of answers resolved my problem ...
-
Is there Any Limit of No. of bytes that can be send to web service? [modified]If Yes ! , then is it Configurable from anywhere ... Regs, Perry
modified on Monday, May 26, 2008 7:38 AM
-
HTTP status 400: Bad RequestHi All, I am currently working with web services and while sending data to web service i am getting this Error: "The request failed with HTTP status 400: Bad Request" :sigh: Can :wtf: anyone tell me why i am getting this Errr ... [OMG] Regards, Perry
-
Error : The request failed with HTTP status 400: Bad Request.Hi All, I am currently working with web services and while sending data to web service i am getting this Error: "The request failed with HTTP status 400: Bad Request" Can anyone tell me why i am getting this Errr ... :omg: Regards, Perry
-
Regarding Problem with Short Data Typein some c++ coding standard guidance i noticed following text written : "Avoid using short as its still generally packaged into a 32 bit chunk of memory. There are very few places where a short can be justified over a long." Can someone explain why is it so ?
-
Hotkey for menu ItemHow to insert a hotkey (Eg. Ctrl+U)in a menu item (through code) in vc++.