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?
...
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...
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...
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...
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...
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 ...
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 ...
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!
...
Hi,
Can you guys tell me the difference between these two objects? Thanks!
...
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 ...
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...
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
...
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...
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...
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...
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...
@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();...
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 ...
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)
...
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...