transactions

transaction question

Evidently I was really wrong in this thread http://stackoverflow.com/questions/3304347/3304365#3304365 how is it that you can get an inconsistent result from a read without a transaction? edit -- the original question was in the context of nhibernate. Is this nhibernate specific? ...

What is the best option, transaction locking for distributed systems?

I am using NHibernate and really new to that. My dilemna is when I open a web browser, it shows the table data. Meantime another person opens another web browser and hence read the existing data from the database. Meantime, I make changes in the my pages and save. And the user save his changes afterwards. When I reload the page, I...

Difference between Transaction Scope and manually defined transactions ?

Hi just reading about using transaction scrope, previously I am used to making transactions inside a single DB class like try { con.Open(); tran = con.BeginTransaction(); OleDbCommand myCommand1 = new OleDbCommand(query1, con); OleDbCommand myCommand2 = new OleD...

Transaction Locked Down SQL Server 2005

Hello Guys, I have noticed something over the last few months. Each time we run a script that has a transaction statements let say we stop the query unexpectedly this action actually lock the database. The only way out is to destroy the transaction each time. I have never experience this before even though I have stopped the query in t...

Which should take initiative task on rollback, App or DB?

MySql InnoDB is set autocommit off and used default isolation level REPEATABLE READ. There are two scenarioes that two distinct transactions T1 and T2 run in the time sequence below, 1) time T1 T2 t1 update row 1->OK t2 update row 2->OK t3 update row 2->wait->timeout error t4 commit or rollb...

Callable or PreparedStatement and transactions

I have a prepared statement call in java that calls a procedure that commits or rolls back a sybase transaction. Is there anyway I can check from my java calls the result of that transaction, ie. success for commit or failure for rollback? Alternatively, I want to check that the procedure completed without errors - whats the best way of ...

mysql transactions in asp.net ?

Hi, Can you guys let me know the way of handling transactions in asp.net? i.e. I have a few queries (Present in different functions and called under various situations) that have to be executed as a whole. So, how should I go about it? Not sure of the syntax and the method/practice for writing the statements in .net (commit, rollback ...

List of things to keep in mind while using transactionscope (asp.net) with mysql?

Hi, Since I am gonna start using transaction scope in my application, I would like to know if there is anything in particular that I should keep in mind while coding the app. The DB is mysql. Thanks! ...

Difference between mysqltransaction object (mysql) and transactionscope object (asp.net)

Hi, Can you guys tell me the difference between these two objects? Thanks! ...

How can asp.net TransactionScope rollback a transaction after the connection is closed?

Hi, Suppose say I am doing a couple of operations. First a delete and then an insert. 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 ...

Need some guidance on a transactional problem (mysql and asp.net)

Hi, Suppose say I have a main function (or in the code behind) In this function, the TransactionScope is say ReadCommitted This main function calls 3 other functions. All these three functions, do a DB operation. The first function increments a sequence number (not auto increment). So, it has its own TransactionScope with isolation le...

TransactionScope rollback working even with autocommit enabled

Hi, I haven't disabled autocommit in my connection. But even then, if there are any issues in the execution, the rollback is working fine. Since the autocommit is enabled, shouldn't the statements be auto committed preventing the rollback from happening? Thanks ...

ASP.NET MVC as a RESTful Service and TransactionScope.

Hi, I'm considering using the MVC 2 Framework as the primary service for a project I'm working on, currently, we're using a WCF based service which works well because I can wrap a TransactionScope on the client and make several calls and be sure that the transaction is successfully transferred to the service. Is that possible using the...

Trouble using MySQL transactions with loops in PHP

Hello all, I am trying to set up a MySQL transaction such that I can loop through a bunch of queries (see below) and if any of them fail, rollback all of the changes. I am finding however that if one fails, not all of the queries are rolled back. Am I doing anything wrong here? mysql_query("START TRANSACTION"); foreach($array1 as...

Multiple transaction managers with @Transactional annotation

We have base generic manager which is inherited by all managers. Base manager is annotated with @Transactional annotations. There are 2 groups of transactional services: x.y.service1.* - have to be managed by transactionManager1 x.y.service2.* - have to be managed by transactionManager2 How can transactions be configured without...

hibernate locked table

Why is this giving me a lock timeout: for(int i = 0; i < playersCount ; i++) { StatUser stats = (StatUser) selectedUsers.get(i).getStatUsers().iterator().next(); int gc = stats.getGamesPlayed(); int gm = stats.getMakeCount(); Session session = HibernateUtil.getSessionFactory().getCurrentS...

EJB CMT TransactionAttributeType.REQUIRES_NEW doesn't work.

@Stateless @LocalBean public class MySLSB { @Resource SessionContext ctx; @PersistenceContext(unitName = "myPU") EntityManager em; public void T1() { em.persist(new MyEntity(1L)); //T1 created! /* wrong call to plain java object T2();...

SQL Server - table seems to be blocked

Using NHibernate, I have just attempted to save a graph of objects using NHibernate. The save failed due to a not-null constraint violation. I am now finding that a table in the database corresponding to one of the objects in the graph now appears to be locked. I cannot query it. Whenever I try, it just sits there doing nothing until I ...

How can I force TransactionScope to use the same connection across Database calls?

Good Morning All, I have code similar to the following try{ using(var tx = new TransactionScope()){ var Xupdated = someDao.DoSomeUpdateQuery(); //this dao uses MS Data ApplicationBlock var Yupdated = someDao.DoSomeOtherUpdateQuery(); //this dao also uses MS Data ApplicationBlock if(Xupdated && Yupdated) ...

Spring Transactional Management - Where to Place the Annotations?

If I have a transactionally managed class, in which I have two methods e.g void OuterMethod(Data somedata) { this.InnerMethod(somedata) } @Transactional("mymanager") void InnerMethod(Data somedata) { //writes some things } is this valid? I can't get it to write to the database for some reason, although it doesn't give me any...