Search Results

Search found 1380 results on 56 pages for 'transactions'.

Page 4/56 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • How does SQL Server treat statements inside stored procedures with respect to transactions?

    - by Sleepless
    Hi All! Say I have a stored procedure consisting of several seperate SELECT, INSERT, UPDATE and DELETE statements. There is no explicit BEGIN TRANS / COMMIT TRANS / ROLLBACK TRANS logic. How will SQL Server handle this stored procedure transaction-wise? Will there be an implicit connection for each statement? Or will there be one transaction for the stored procedure? Also, how could I have found this out on my own using T-SQL and / or SQL Server Management Studio? Thanks!

    Read the article

  • DO NOT BOTHER. THE PROBLEM IS NOT TRANSACTIONS. DUNNO HOW TO CLOSE / DELETE

    - by matti
    THE PROBLEM IS SOLVED. I DUNNO HOW TO CLOSE THIS QUESTION. ANOTHER SERVICE IS PROPABLY RUNNING AT ALMOST SAME SYNC THAT DOES THE THING. MY WORK "MATE" WILL HEAR A THING OR TWO IN THE MORNING. I have following code in windows service: data is in the dataset and it has been populated earlier and then rows are updated and inserted to dataset tables before calling code below. using (dataSetTxn = _cnctn.BeginTransaction()) { try { _somePlanAdptr.UpdateCommand.Transaction = dataSetTxn; _someLogAdptr.InsertCommand.Transaction = dataSetTxn; _someLinkAdptr.InsertCommand.Transaction = dataSetTxn; _someDataAdptr.InsertCommand.Transaction = dataSetTxn; _log.WriteDebug("Updating SomePlanAction"); _somePlanAdptr.Update(_ofDataSet, "SomePlanAction"); _log.WriteDebug(string.Format("Inserting {0} rows to SomeLog")); //error _someLogAdptr.Update(_ofDataSet, "SomeLog"); _log.WriteDebug(string.Format("Updating SomeLink with {0} rows", _ofDataSet.Tables["SomeLink"].Rows.Count)); _someLinkAdptr.Update(_ofDataSet, "SomeLink"); _log.WriteDebug(string.Format("Updating SomeData with {0} rows", _ofDataSet.Tables["SomeData"].Rows.Count)); _someDataAdptr.Update(_ofDataSet, "SomeData"); _log.WriteDebug("Commiting all changes to database."); dataSetTxn.Commit(); } catch (Exception e) { _log.WriteError("Updating database failed -> rollback", e); if (dataSetTxn != null && _cnctn.State == ConnectionState.Open) dataSetTxn.Rollback(); throw e; } } so one of the lines causes an exception log.WriteDebug(string.Format("Inserting {0} rows to SomeLog")); //error still the first adapter's data is updated to database. when debugged the data is not yet updated until the method that calls all (including this bit) exits. The method that does all is timed with System.Threading.Timer. Thanks & BR -Matti

    Read the article

  • Have I to count transactions before rollback one in catch block in T-SQL?

    - by abatishchev
    I have next block in the end of each my stored procedure for SQL Server 2008 BEGIN TRY BEGIN TRAN -- my code COMMIT END TRY BEGIN CATCH IF (@@trancount > 0) BEGIN ROLLBACK DECLARE @message NVARCHAR(MAX) DECLARE @state INT SELECT @message = ERROR_MESSAGE(), @state = ERROR_STATE() RAISERROR (@message, 11, @state) END END CATCH Is it possible to switch CATCH-block to BEGIN CATCH ROLLBACK DECLARE @message NVARCHAR(MAX) DECLARE @state INT SELECT @message = ERROR_MESSAGE(), @state = ERROR_STATE() RAISERROR (@message, 11, @state) END CATCH or just BEGIN CATCH ROLLBACK END CATCH ?

    Read the article

  • How can I ensure that nested transactions are committed independently of each other?

    - by Caldera
    If I have a stored procedure that executes another stored procedure several times with different arguments, is it possible to have each of these calls commit independently of the others? In other words, if the first two executions of the nested procedure succeed, but the third one fails, is it possible to preserve the results of the first two executions (and not roll them back)? I have a stored procedure defined something like this in SQL Server 2000: CREATE PROCEDURE toplevel_proc .. AS BEGIN ... while @row_count <= @max_rows begin select @parameter ... where rownum = @row_count exec nested_proc @parameter select @row_count = @row_count + 1 end END

    Read the article

  • What does transactions per seconds for a load balancer mean

    - by Anurag
    I was looking at the product matrix of webmux 592G(load balancer). It says maximum connections per sec = 2.8M Maximum number of transactions = 100,000 What does the above numbers mean. Does above means that load balancer can have 2.8M connections open but only 100K of them will be active per seconds. Also incase any one has used webmux 592G do you guys know in practice how many connections it can have open and what qps it can serve

    Read the article

  • Long-running transactions structured approach

    - by disown
    I'm looking for a structured approach to long-running (hours or more) transactions. As mentioned here, these type of interactions are usually handled by optimistic locking and manual merge strategies. It would be very handy to have some more structured approach to this type of problem using standard transactions. Various long-running interactions such as user registration, order confirmation etc. all have transaction-like semantics, and it is both error-prone and tedious to invent your own fragile manual roll-back and/or time-out/clean-up strategies. Taking a RDBMS as an example, I realize that it would be a major performance cost associated with keeping all the transactions open. As an alternative, I could imagine having a database supporting two isolation levels/strategies simultaneously, one for short-running and one for long-running conversations. Long-running conversations could then for instance have more strict limitations on data access to facilitate them taking more time (read-only semantics on some data, optimistic locking semantics etc). Are there any solutions which could do something similar?

    Read the article

  • Entities groups in transactions

    - by Joel
    In the context of "Keys and Entity Groups" article by google: http://code.google.com/appengine/docs/python/datastore/transactions.html 1) "Only use entity groups when they are needed for transactions" 2) "Every entity belongs to an entity group, a set of one or more entities that can be manipulated in a single transaction." It seems like entity groups exist only for the use of transactions, i.e. making one transaction possible between all entities in a group. My question is then why are there parent-child relations between entities and not just a simple declaration of entities to be in a single group (that is defining A,B,C to be in the same group as opposed to defining relations between them "A (parent of) B, B (parent of C)"). What is the benefit from using parent-child relation model when the only purpose is for entities to be in the same group to make transaction possible? Thanks Joel

    Read the article

  • Can I do transactions and locks in CouchDB?

    - by damian
    I need to do transactions (begin, commit or rollback), locks (select for update). How can I do it in a document model db? Edit: The case is this: I want to run an auctions site. And I think how to direct purchase as well. In a direct purchase I have to decrement the quantity field in the item record, but only if the quantity is greater than zero. That is why I need locks and transactions. I don't know how to address that without locks and/or transactions. Can I solve this with CouchDB?

    Read the article

  • DBTransactions between stateless calls using GUIDs

    - by Marty Trenouth
    I'm looking to add transactional support to my DB engine and providing to Abstract Transaction Handling down to passing in Guids with the DB Action Command. The DB engine would run similar to: private static Database DB; public static Dictionary<Guid,DBTransaction> Transactions = new ...() public static void DoDBAction(string cmdstring,List<Parameter> parameters,Guid TransactionGuid) { DBCommand cmd = BuildCommand(cmdstring,parameters); if(Transactions.ContainsKey(TransactionGuid)) cmd.Transaction = Transactions[TransactionGuid]; DB.ExecuteScalar(cmd); } public static BuildCommand(string cmd, List<Parameter> parameters) { // Create DB command from EntLib Database and assign parameters } public static Guid BeginTransaction() { // creates new Transaction adding it to "Transactions" and opens a new connection } public static Guid Commit(Guid g) { // Commits Transaction and removes it from "Transactions" and closes connection } public static Guid Rollback(Guid g) { // Rolls back Transaction and removes it from "Transactions" and closes connection } The Calling system would run similar to: Guid g try { g = DBEngine.BeginTransaction() DBEngine.DoDBAction(cmdstring1, parameters,g) // do some other stuff DBEngine.DoDBAction(cmdstring2, parameters2,g) // sit here and wait for a response from other item DBEngine.DoDBAction(cmdstring3, parameters3,g) DBEngine.Commit(g) } catch(Exception){ DBEngine.Rollback(g);} Does this interfere with .NET connection pooling (other than a connection be accidently left open)? Will EntLib keep the connection open until the commit or rollback?

    Read the article

  • Spring, iBatis, MySQL - how to manage transactions?

    - by Enrique
    Hello I'm building a web application with spring ibatis and mysql. I'm going to use mysql stored procedures and I will call them with ibatis. My question is about how to manage the transactions. Should I manage the transactions inside the stored procedures or with spring/ibatis or with both?

    Read the article

  • Using pivot tables to group transactions

    - by andreas
    I have my bank account statement and what I would like to do is group the descriptions of the transactions together with their debit or credit and sum their total. I could then see that, e.g., for ebay.com my total debit was $2000, etc. Description Debit Credit A 1 B 1 A 1 B 1 C 1 D 1 A 1 What I want to do is use a pivot table Description Debit Credit A 3 B 2 C 1 D 1 I am no able to do that, as I can't group the description and have additional debit and credit columns -- I get them all in rows with blanks.

    Read the article

  • NHibernate transactions randomly not rolled back

    - by cbp
    I have a suite of integration tests that run inside transactions. Sometimes it seems that NHibernate transactions are not being correctly rolled back. I can't work out what causes this. Here is a slightly simplified overview of the base class that these integration test fixtures run with: public class IntegrationTestFixture { private TransactionScope _transactionScope; private ConnectionScope _connectionScope; [TestFixtureSetUp] public virtual void TestFixtureSetUp() { var session = NHibernateSessionManager.SessionFactory.OpenSession(); CallSessionContext.Bind(session); _connectionScope = new ConnectionScope(); _transactionScope = new TransactionScope(); } [TestFixtureTearDown] public virtual void TestFixtureTearDown() { _transactionScope.Dispose(); _connectionScope.Dispose(); var session = CurrentSessionContext.Unbind(SessionFactory); session.Close(); session.Dispose(); } } A call to the TransactionScope's commit method is never made, therefore how is it possible that data still ends up in the database?

    Read the article

  • hibernate transaction safety (with, without JBoss)

    - by Andy Nuss
    Hi, I am currently using just Hibernate and tomcat (no JBoss), and have hibernate transactions which I'm not clear on what transaction safety level I'm actually using, especially for those which read and get values and then update them). Thus I might be getting dirty reads? So I'm going to start having to study my transactions that require non-dirty reads, and make sure that (1) hibernate controls the transaction safety level of those transactions properly, and (2) be able to still have those transactions where dirty reads are ok. Do I need to install Hibernate with JBoss to control transaction safety levels? If so, what's the easiest way to do this without dramatically changing my application to use the J2EE apis, as I am currently using the basic Hibernate apis. Or better, can I get JTA control with Hibernate without using JBoss? Andy

    Read the article

  • Better understanding of my SQL transactions

    - by Slew Poke
    I just realized that my application was needlessly making 50+ database calls per user request due to some hidden coding -- hidden in the sense that between LINQ, persistence frameworks and events it just so turned out that a huge number of calls were being made without me being aware. Is there a recommended way to analyze individual transactions going to my SQL 2008 database, preferably with some integration to my Visual Studio 2010 environment? I want to be able to 'spy' on individual transactions being made, but only for certain pieces of my code, and without making serious changes to either the code or database.

    Read the article

  • How to avoid StaleObjectStateException when transaction updates thousands of entities?

    - by ThinkFloyd
    We are using Hibernate 3.6.0.Final with JPA 2 and Spring 3.0.5 for a large scale enterprise application running on tomcat 7 and MySQL 5.5. Most of the transactions in application, lives for less than a second and update 5-10 entities but in some use cases we need to update more than 10-20K entities in single transaction, which takes few minutes and hence more than 70% of times such transaction fails with StaleObjectStateException because some of those entities got updated by some other transaction. We generally maintain version column in all tables and in case of StaleObjectStateException we generally retry but since these longs transactions are anyways very long so if we keep on retrying then also I am not very sure that we'll be able to escape StaleObjectStateException. Also lot of activities keep updating these entities in busy hours so we cannot go with pessimistic approach because it can potentially halt many activities in system. Please suggest how to fix such long transaction issue because we cannot spawn thousands of independent and small transactions because we cannot afford messed up data in case of some failed & some successful transactions.

    Read the article

  • Setting a time limit for a transaction in MySQL/InnoDB

    - by Trevor Burnham
    This sprang from this related question, where I wanted to know how to force two transactions to occur sequentially in a trivial case (where both are operating on only a single row). I got an answer—use SELECT ... FOR UPDATE as the first line of both transactions—but this leads to a problem: If the first transaction is never committed or rolled back, then the second transaction will be blocked indefinitely. The innodb_lock_wait_timeout variable sets the number of seconds after which the client trying to make the second transaction would be told "Sorry, try again"... but as far as I can tell, they'd be trying again until the next server reboot. So: Surely there must be a way to force a ROLLBACK if a transaction is taking forever? Must I resort to using a daemon to kill such transactions, and if so, what would such a daemon look like? If a connection is killed by wait_timeout or interactive_timeout mid-transaction, is the transaction rolled back? Is there a way to test this from the console? Clarification: innodb_lock_wait_timeout sets the number of seconds that a transaction will wait for a lock to be released before giving up; what I want is a way of forcing a lock to be released. Update: Here's a simple example that demonstrates why innodb_lock_wait_timeout is not sufficient to ensure that the second transaction is not blocked by the first: START TRANSACTION; SELECT SLEEP(55); COMMIT; With the default setting of innodb_lock_wait_timeout = 50, this transaction completes without errors after 55 seconds. And if you add an UPDATE before the SLEEP line, then initiate a second transaction from another client that tries to SELECT ... FOR UPDATE the same row, it's the second transaction that times out, not the one that fell asleep. What I'm looking for is a way to force an end to this transaction's restful slumber.

    Read the article

  • MSDTC - Communication with the underlying transaction manager has failed (Firewall open, MSDTC network access on)

    - by SocialAddict
    I'm having problems with my ASP.NET web forms system. It worked on our test server but now we are putting it live one of the servers is within a DMZ and the SQL server is outside of that (on our network still though - although a different subnet) I have open up the firewall completely between these two boxes to see if that was the issue and it still gives the error message "Communication with the underlying transaction manager has failed" whenever we try and use the "TransactionScope". We can access the data for retrieval it's just transactions that break it. We have also used msdtc ping to test the connection and with the amendments on the firewall that pings successfully, but the same error occurs! How do i resolve this error? Any help would be great as we have a system to go live today. Panic :) Edit: I have created a more straightforward test page with a transaction as below and this works fine. Could a nested transaction cause this kind of error and if so why would this only cause an issue when using a live box in a dmz with a firewall? AuditRepository auditRepository = new AuditRepository(); try { using (TransactionScope scope = new TransactionScope()) { auditRepository.Add(DateTime.Now, 1, "TEST-TRANSACTIONS#1", 1); auditRepository.Save(); auditRepository.Add(DateTime.Now, 1, "TEST-TRANSACTIONS#2", 1); auditRepository.Save(); scope.Complete(); } } catch (Exception ex) { Response.Write("Test Error For Transaction: " + ex.Message + "<br />" + ex.StackTrace); }

    Read the article

  • T-SQL Tuesday #31: Paradox of the Sawtooth Log

    - by merrillaldrich
    Today’s T-SQL Tuesday, hosted by Aaron Nelson ( @sqlvariant | sqlvariant.com ) has the theme Logging . I was a little pressed for time today to pull this post together, so this will be short and sweet. For a long time, I wondered why and how a database in Full Recovery Mode, which you’d expect to have an ever-growing log -- as all changes are written to the log file -- could in fact have a log usage pattern that looks like this: This graph shows the Percent Log Used (bold, red) and the Log File(s)...(read more)

    Read the article

  • Magento - Authorize.net - Get Payment Update for expired transactions

    - by pspahn
    Magento 1.6.1 I have set up Authorize.net (AIM) for the client's store. Previously they were using saved CC method and entering information manually in Authorize.net's merchant terminal. Most of it is working as expected, however for transactions that are flagged as 'Suspected Fraud' by Authorize.net, if the client does not update the transaction manually before the authorization expires, using 'Get Payment Update' in Magento fails because the transaction is expired (I believe it's five days for an authorize only transaction). For the client, it seems the only way to update this order in Magento is to simply delete the order, as it doesn't appear the Paygate model knows about expired transactions. Performing 'Get Payment Update' simply returns 'There is no update for this payment'. I have already modified the file: /app/code/core/Mage/Paygate/Model/Authorize.net to have the correct API URL as described in issue #27117 ( http://www.magentocommerce.com/bug-tracking/issue?issue=12991 - must be logged in to view ). This resolved the button not working for all other orders; however this does not fix the issue I am describing. Is anyone familiar with Authorize.net's AIM API so that we can update these orders in Magento to something that makes sense (canceled, etc.) without having to delete the order? I am thinking it should be a case of adding a new order status to Magento, checking the update for an 'Expired' status, and setting the order to the newly created order status. -- edit -- I just ran a diff for the file mentioned above and noticed that Magento 1.7.0.2 includes the _isTransactionExpired() method which seems like it would be the fix. Can it be as simple as updating this model with the newer version?

    Read the article

  • Sharing transactions between web applications, which run in the same cluster

    - by pihentagy
    We (will) have the following architecture: Base.war will be a self-contained spring-hibernate application All applications will run under Glassfish, and may be clustered E1.war will sit on top of Base.war, extending it's functionality There could be further extensions (E2.war, E3.war, …) sitting on top of Base.war Either wars could start a transaction, and transactions could span between wars Without shutting down Base.war, or any other Ex.war, it should be possible to upgrade an Ey.war Is there a solution for this with spring-hibernate-glassfish environment?

    Read the article

  • Paypal Mass pay fails when large transactions are made

    - by Sid
    I am using the paypal mass pay feature but i am unable to make payments greater than $20. When I attempt to make large transactions (say for $120) i get the error that says the account has insufficient funds. My account has more than the requisite amount to make the payment. I am trying to find a solution as there is no documentation that says anything about an a limit for each payment in the mass pay api. I would appreciate any help on this.

    Read the article

  • Php + mysql transactions examples

    - by Donator
    I really haven't found normal example of php file where mysql transactions are being used. Can you show me simple example of that? And one more question. I've already created a lot of programming and didn't use transaction, maybe I can put any php function or smth to header.php that if one mysql_query fails, then others too? Thank you.

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >