|
In one transaction I am creating a table which references another table. In a second transaction, I run a SELECT-query against the referenced table but it is blocked by the first transaction. Why is that?
Transaction A:
BEGIN TRAN CREATE TABLE Child (...
Started by Mathias on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
( MSDNyou can test this out in management studio:
1) open a new window A, run this:
CREATE TABLE Parent (id int NOT NULL primary key);....
The FK
Could it be that the first transaction is still open thus keeping a lock on the table.
|
|
Can the SQL "truncate table" command be used within a transaction? I am creating an app and my table has a ton of records. I want to delete all the records, but if the app fails I was to rollback my transaction. Deleting each record takes a very long ...
Started by Fred Clown on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
AFAIK, if there is....
In Oracle, TRUNCATE TABLE is a DDL statement that cannot be used in a transaction (or, more accurately, cannot be rolled back).
It does write page deallocation to the log, as you mentioned .
From a transaction.
|
|
Hi, After inserting into masterTable it returns an ID, with that id i want to enter more than one record into transaction table.
now i am using two seperate procedures, the problem is after inserting the record into master, and while inserting into transaction...
Answer Snippets (Read the full thread at stackoverflow):
Any and all data modifications following....
Do it inside a transaction:
BEGIN TRANSACTION EXECUTE prc_insert_master @value EXECUTE prc_insert database data modifications commands into a "all or nothing" set of work, use a transaction.
|
Ask your Facebook Friends
|
Hello All,
I'm new to SQL. I have a large number of stored procedures in my production database. I planned to write an audit table that would be used by these stored procedures to keep track of changes ( these stored procedures would write to this audit...
Started by Prabhu on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
What....
Now inthe catch block for the transaction performYou can't, once a session starts a transaction all activity on that session is contained inside the transaction.
That it is a table variable and not a temp table.
|
|
This SQL (called from c#) occasionally results in a deadlock. The server is not under much load so the approach used is to lock as much as possible.
-- Lock to prevent race-conditions when multiple instances of an application calls this SQL: BEGIN TRANSACTION...
Started by Thomsen on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
Using Table Locks can a single record in the same table you are locking completely, so locking the entire table increases.
You could also avoid the table lock and use isolation level serializable.
Needs.
|
|
I have a procedure like this:
create procedure Checkout @Foo nvarchar(20), @cost float as begin transaction declare @Bar nvarchar(20); select @Bar = Bar from oFoo where Foo = @Foo; update Foo set gold = gold - @cost where name = @Foo; update Bar set gold...
Started by Omu on
, 4 posts
by 4 people.
Answer Snippets (Read the full thread at stackoverflow):
(Based on SQL Server....
This option is the SQL Server default.
Even if somebody comes transaction, resulting in nonrepeatable reads or phantom data.
But this will lock the whole table for exclusive access by that one transaction.
|
|
Hello, I want to know if open a transaction inside another is safe and encouraged?
I have a method:
def foo(): session.begin try: stuffs except Exception, e: session.rollback() raise e session.commit()
and a method that calls the first one, inside a transaction...
Answer Snippets (Read the full thread at stackoverflow):
The database knows nothing of the nesting, you can't do anything to use transaction control inside functions....
Because the transaction is virtual - i.e.
The rollback however is issued immediately.
The outermost transaction commits.
|
|
We are having problem with the server migration. We have one application that are having so much transactions It working fine on the one database server. But when transfer same database to another server. We are facing the following error.
Server: Msg...
Started by jalpesh on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
Are you receiving type differnce, or a data length differnce... .
So this message is a consequence, rather than a cause .
After that the transaction must fail.
This message means one of the other participants in the transaction voted to rollback.
|
|
I have found that if I modify table X via SQLplus and don't commit the change, then if my web appliation (which runs as a PHP script under Apache in ModPHP mode) attempts to commit a change to table X it will block indefinitely until I commit my changes...
Started by Peter on
, 3 posts
by 3 people.
Answer Snippets (Read the full thread at stackoverflow):
Using mysqli::options....
The best way to do that would be to use PHP's MySQLi module rather than the MySQL module, because then you have access to the mysqli::options function .
I think for this situation I would try to control the query timeout directly .
|
|
It seems like I will be needing transaction with MySQL and I have no idea how should I manage transactions in Mysql with mixed InnoDB/MyISAM tables, It all seems like a huge mess.
You might ask why would I ever want to mix the tables together... the anwer...
Started by Orentet on
, 5 posts
by 5 people.
Answer Snippets (Read the full thread at stackoverflow):
Any data you need transactions for must be in an InnoDB table and you manage the transactions using (such as full table scan reporting, etc..), but InnoDB can actually be faster in many cases with normal data structure....
|