I have written several queries under one single transaction. When any of the query throws an error then the whole transaction should rollback. However, in some rare cases say 2% cases even after the error the next transaction is getting comitted.
note that all transaction processes (opening, committing and rollback) is done through .net.
I am using 64bit windows 2003 for data and application server. And website is configured for runapp32on64.
Now, these two operations are done with two different connections (say con1 and con2). Both these connections are enlisted in the same TransactionScope.
Before the delete/insert operations the connections are opened and immediately closed.
So, now if the insert fails, then how is the delete rollbacked since con1 has been closed?
Can I code to add transaction for some subs? If there is an error in any sub will roll back.For example, sub1 delete some tablessub2 insert data into tables which just be deletedsub3 send out confirmation emailsub4 make submit button disable
I have a transaction that has 5 update statements.I am checking that the data is the same as it was when i selected it before i change it, as this will be from a web app that many people could update.
I want to check that the rowcount is 1 everytime i make an update, if it is one then I want to move on, if not I want to rollback and return.
Here is what I have, only it it rolling back on the first attempt everytime.
[Code]....
I am not sure if rowcount is available yet, if not what do I need to use to find out if anyrows are being updated before moving on?
I was facing some serious deadlock issues in a high transaction table.For some select statement i have added nolock .But for few i can not put nolock, as i need accurate data.this select statement becomes a deadlock victim at times.
I code to exec a store procedre (sp_truncate) to truncate 10tables and using sqlBulkCopy to download a huge data. Both them are working fine.Now I want to use transaction with application (not in store procedure) torollback truncate tables if download is failed.Is it possible to use transaction to work with these two steps?
I'm doing a transaction type that is similar to iBank where people can add their payee. In my SQL database, I have a transaction table which has the date variable. I would like to set in a way that if the user did not express interests to activate the payee, the record will be expired after 1hour.
I'm getting "This SqlTransaction has completed; it is no longer usable" exception when try to commit my transaction after sqlreader is close.Here is the code sample
[Code]....
...so when I get to commit the transaction it raises the mentioned exception: "This SqlTransaction has completed; it is no longer usable". I have also noticet that Command.Transaction becomes NULL after reader.Close()My question is: Can I use SqlDataReader and SqlTransaction ? Maybe to use BeginExecuteReader and EndExecuteReader ?
Does a DB transaction get automatically rolled back during exception or we should explicitily write transaction .Rollback inside the catch block to rollback a transaction...
i have a method that do bunch of inserts in a table
these inserts done through a transaction (with default isolation level)
meanwhile i need to read some committed records from this table by using another method, i create another transaction for 2th method with a ReadCommitted isolation level but it just fails and return a timeout error and also, the DoTransaction cause the entire table inaccessible, how could i apply a row-level lock ?
I've got an odd problem and can't figure out what's causing it. We've got 2 different DataSets in the same project and I'm seeing different generated code from the MSDataSetGenerator. Both projects are .NET Framework 4.
In one DataSet, I can open the .Designer.cs file and there's a line like:
[Code]....
This essentially exposes a Transaction property to any partial class I create so I can do with it what I want (by setting it to something).
In the other DataSet no matter what I try to do, this Transaction property never gets generated. I've right-clicked on both DataSets and chose "Run Custom Tool" to get them to regenerate (I've even tried deleting the .Designer.cs file before doing this) and they both get generated the same.
I tried to make sure all the properties of the DataSets were the same. Both are using .NET Framework 4.0 and VS2010.
The file that does not generate the Transaction was from a .NET 1.0 asp.net web site that has continually been upgraded through different .NET versions. Right now it's at 4.0 but I don't know if that would have anything to do with it.
I make an asynchronous call from one web service to another web service deployed on different server? The scenario is that an ASP.NET webforms page will call a web service in an async manner. This particular web service will then make another async call to a second web service deployed on different web server. This this possible to achieve, and what additional steps or code would be necessary to make this happen?
Does anyone have a sample code on this? I want to call the FedEx "Rate Available Services/Rate Shopping" Service to retrieve pricing for various services.
My requirement is i need to display some quotes from some vendors in my User Interface. Some of the quote details will be fetched from database where as some vendors are giving web services to get the quote results. I need to combine the quotes from database as well as the various web service response and display in the grid.
I am posting this as a part of my effort in searching the best possible design solution for my requirement. I am currently working on a complex server control(not user control) in asp.net which is going to be rendered into html elements on the client side.And those html elements needs to do a ajax call backs to the server using js/jquery. Here is the problem. As this is a serverside control and can be added into any application/domain. I dont want to have those callback services hosted separately. Is there any way that I can host those server callback services in the same library? If so, how can I access them from the client side?
I have a stored procedure which is part of the aspnetdb but i am using my own database and therefore these stored procedures are added on my sql server locally.So i uploaded the databases to my hosting company 1and1 and created the stored procedures and tables as those in aspnetdb but i get the error as in the title. this is a standard stored procedure which lives in the aspnetdb database but not sure why this is happeningthe code is below which is for aspnet membership createuser a standard stored procedure
I'm working on a web application using VB.NET. In page load event am calling a remote web service which take time to bring the data. During this process none of the other contents on page are shown(render).
I want to call this remote web service asynchronously so that other data of page is displayed and web service data will be displayed when its available.
I have a fairly complex business application written in ASP.NET that is deployed on a hosted server. The site uses Forms Authentication, and there are about a dozen different roles defined. Employees and customers are both users of the application.
Now I have the requirement to develop a Windows Mobile client for the application that allows a very specialized set of tasks to be performed from a device, as opposed to a browser on a laptop. The client wants to increase productivity with this measure. Only employees will use this application.
I feel that it would make sense to re-use the security infrastructure that is already in place. The client does not need offline capability.
My thought is to deploy a set of web services to a folder of the existing site that only the new role "web service" has access to, and to use Forms Authentication (from a Windows Mobile 5/.Net 3.5 client).
I did see this question and I am aware of the limitations that Forms Authentication poses. Since security is not my primary motivator (I use SSL and can restrict access by IP address), but rather using existing user accounts and roles, my decision tree is somewhat different as well.
The type My.API.Class is ambiguous: it could come from assembly '[on Temporary ASP.NET Files]' or from assembly '[on bin folder]'
The problem occurs when debugging a Web App, speciically when making a request to a WebMethod of a WebService.The project compiles just right. It generates My.Website.dll on bin folder and if I publish the Web Application. It works fine.The asmx file is on the root of the application. The CodeBehind file is on App_Code and its marked to be compiled to generate My.Website.dll.The way this person exposes its problem is somehow similar but I get starting to be lost when he talks about a proxy class and shared dlls I don't use.
I've got all of my ASP.NET requests wrapped in a Session and a Transaction that gets commited only at the very end of the request. At some point during execution of the request, I would like to insert an object and make it visible to other potential threads - i.e. split the insertion into a new transaction, commit that transaction, and move on. The reason is that the request in question hits an API that then chain hits another one of my pages (near-synchronously) to let me know that it processed, and thus double submits a transaction record, because the original request had not yet finished, and thus not committed the transaction record.
So I've tried wrapping the insertion code with a new SessionScope, TransactionScope(TransactionMode.New), combination of both, flushing everything manually, etc. However, when I call Refresh on the object I'm still getting the old object state. Here's some code sample for what I'm seeing:
Post outsidePost = Post.Find(id); // status of this post is Status.Old using (TransactionScope transaction = new TransactionScope(TransactionMode.New)) { Post p = Post.Find(id); p.Status = Status.New; // new status set here p.Update(); SessionScope.Current.Flush(); transaction.Flush(); transaction.VoteCommit(); } outsidePost.Refresh(); // refresh doesn't get the new status, status is still Status.Old