I've written some tests for .net code that invokes calls to my SQL Server. It appears that using System.Transactions is an excellent choice for rolling back any modifications to the database that result. I'm aware that some purists would suggest that I might want to mock the database, but I'm not going down that road; this is not stric...
I am using SQL Server 2008 Enterprise. And using ADO.Net + C# + .Net 3.5 + ASP.Net as client to access database. When I access SQL Server 2008 tables, I always invoke stored procedure from my C# + ADO.Net code.
My question is, if I do not have any transaction control (I mean begin/end transaction) from my client C# + ADO.Net code, and I...
How long can a MySQL transaction last until it times out? I'm asking because I'm planning to code an payment process for my e-commerce project somewhere along the lines of this (PHP/MySQL psuedo-code):
START TRANSACTION;
SELECT...WHERE id IN (1,2,3) AND available = 1 FOR UPDATE; //lock rows where "available" is true
//Do payment proce...
I have the following relationship:
// In A.java class
@OneToMany(mappedBy="a", fetch=FetchType.LAZY)
@Cascade(CascadeType.SAVE_UPDATE)
private List<B> bList;
// In B.java class
@ManyToOne(fetch=FetchType.LAZY)
@JoinColumn(name="id_a")
@Cascade(CascadeType.SAVE_UPDATE)
private A a;
I get this exception:
StaleStateException: Batch upd...
Title says it all: What is the difference between a UserTransaction and a EntityTransaction?
My rudimentary understanding is that UserTransaction is used when JTA is required (e.g. to do queries on mulitple things), and that EntityTransaction is used when JPA only is required (e.g. when the query is atomic).
Is that the only difference...
finally
{
// Commit the transaction.
sqlTran.Commit();
reader.Close();
reader.Dispose();
conn.Close();
conn.Dispose();
}
i would like to give the user an option of opps! roll it back
so its commited can it be rolled back?
...
I’m writing a client that receives messages from an external Websphere MQ Queue and puts them on an internal MSMQ Queue. The client will use MQ Client or, preferably, be purely managed (MQC.TRANSPORT_MQSERIES_MANAGED).
Based on an example from IBM, I have a version up and running that can do a simple IBM.WMQ.MQQueue.Get(…). How can this...
This question is related to my question: http://stackoverflow.com/questions/3072986/sql-server-and-transactionscope-with-msdtc-sporadically-cant-get-connection
I'm doing some transaction programming using the .net TransactionScope class. If I understand correctly, I can do some SQL operations within a transaction by wrapping the SQL ca...
I'm using transactions in a MySQL database, along with Ajax, and I'm having some troubles with scripts timing out. So, here's a rundown of what happens:
Ajax script on page makes request to server.
Server receives request; script starts a MySQL transaction.
Ajax script is set to timeout after two seconds; times out; tells server to abo...
Hello,
I would Like to ask you, if there is a way to set some operations into transaction.
I have problem such like this:
1) Generate File from data from database
2) Encrypt it
3) Send to server
I would like do it in one transaction. Any failured step 1-3 should cause the cancelling transaction.
Best regards,
...
I have searched the MySql documentation and found nothing. I have tried this ... the Rollback doesn't seem to cancel the inserts made in table1 and table2
Start Transaction;
INSERT INTO Table1(field1,field2) VALUES (value1, value2);
INSERT INTO Table2(field3,field4) VALUES (value3, value4);
INSERT INTO Table3(field5,field6) VALUES (...
I have PHP code that execute a stored procedure 10 times. If one stored procedure call fails, it should continue on, and at the end commit the transaction.
It basically looks like this:
$connection = getConn();
foreach($row as $i=>$j) {
$SQL = "BEGIN MYPROC.EXECUTE(:VAL1, :VAL2); END;";
$statement = OCIParse($connection, $SQL);
...
Hi guys,
What's the point to enclose select statements in a transaction? I think select statements are just "GET" data from the database, they don't have chance to rollback something, because you just can't change the data. So, does that to say we never need put select statements in a transaction? Am I right?
Thanks.
...
I'm having the following issue:
I'm inserting a row to table (say, 'temp') inside a transaction (default ADO.NET transaction). Until that transaction is committed, the command 'select * from temp', running from another session (SQL Server 2008 management studio), is blocked and cannot be completed.
This seems weird to me. Shouldn't the...
Is there any configuration based alternative to the @Transactional annotation in Spring?
I want to keep my java classes as free from Spring as possible, i.e. as decoupled as possible from any framework.
...
I have a table of Persons and a table of Things, where each Thing is owned by a Person and each Person has a FavoriteThing.
Persons
PersonID int <PK>
FavoriteThingID int <FK>
Things
ThingID int <PK>
PersonID int <FK>
I would like to be able to add a Person and his/her favorite Thing, as well as setting that Thing's Person...
For fun I am replacing the mysqli extension in my app with PDO.
Once in awhile I need to use transactions + table locking.
In these situations, according to the mysql manual, the syntax needs to be a bit different. Instead of calling START TRANSACTION, you do it like so...
SET autocommit=0;
LOCK TABLES t1 WRITE, t2 READ, ...;
... do ...
I have a MySQL table which basically serves as a file index. The primary key of each record is also the name of a file in a directory on my web host.
When the user wants to delete a file from the system, I want to ensure some kind of transaction safety, i.e. if something goes wrong while deleting the file the record is not erased, and i...
Hello
I was wondering if it's possible to get the resultset of the select query from my transaction. Mysql returns that the table was updated, but returned 0 rows.
This is the transaction:
START TRANSACTION;
SELECT *, @A:=id FROM mailer_log LIMIT 0,10;
UPDATE mailer_log SET picked=1 WHERE id=@A;
COMMIT;
...
Hello all,
Consider a transaction-per-view model where with an IHttpModule i open a transaction using a standard ISession.
Now, i have a page where i want to do some batch operations. Since IStatelessSession is preferred for batch operations:
Can i have both ISession and IStatelessSession open at the same time? Is it safe?
If 1. yes...