Reqiured Transaction and Required New Transaction 
Author Message
 Reqiured Transaction and Required New Transaction

Hello All,

I am developing a COM+ application with VB and SQL Sever 2000
I have written two component, one called "Confirm" with transaction level
"Required Transaction" while the other one called "LockRecord" with
transaction level
set to "Required New Transaction".

For the component "Confirm", it will select records from database and then
do some checking
before insert into database. The "LockRecord" component use to insert the
selected records of
"Confirm" into database and so other user can't know that these records have
been locked by
another user so that they can't select these records by the query.

Now, I have a big problem with this two component. When the "LockRecord"
component called
by the "Confirm" component, it will hold on the part when connect to the
database. I have changed
the type to connect the database like command object, connection object and
recordset directly, but
all of them also suffer from the "hold" situation with database and at last
will go to the Error Handling
with error "ODBC connection timeout". I have analysis the connection of the
database from SQL Server
Server Profiler, it show that when the "LockRecord" component with
transaction level set to "Required New Transaction",
the duration of the  execution of the query is about 1000 times with the
duration when the "LockRecord" component
with transaction level set to "Required Transaction".

Maybe you can said I can set the transaction level to "Required Transaction"
so that I can have faster execution time.
However, coz I want to let other user can "see" the record insert by the
"LockRecord" component, so I can only use
"Required New Transaction", otherwise, other can "see" the records.

As result, do anyone have any idea to solve it? thx !

Br,
Rayman



Sun, 04 Jan 2004 23:34:02 GMT  
 Reqiured Transaction and Required New Transaction
Hi Raymen,

You might be having a deadlock. Use SQL PerfMon to check it.

Regards,
Dmitriy Zakharov.
Brainbench MVP for Visual Basic
http://www.brainbench.com


Quote:
> Hello All,

> I am developing a COM+ application with VB and SQL Sever 2000
> I have written two component, one called "Confirm" with transaction level
> "Required Transaction" while the other one called "LockRecord" with
> transaction level
> set to "Required New Transaction".

> For the component "Confirm", it will select records from database and then
> do some checking
> before insert into database. The "LockRecord" component use to insert the
> selected records of
> "Confirm" into database and so other user can't know that these records
have
> been locked by
> another user so that they can't select these records by the query.

> Now, I have a big problem with this two component. When the "LockRecord"
> component called
> by the "Confirm" component, it will hold on the part when connect to the
> database. I have changed
> the type to connect the database like command object, connection object
and
> recordset directly, but
> all of them also suffer from the "hold" situation with database and at
last
> will go to the Error Handling
> with error "ODBC connection timeout". I have analysis the connection of
the
> database from SQL Server
> Server Profiler, it show that when the "LockRecord" component with
> transaction level set to "Required New Transaction",
> the duration of the  execution of the query is about 1000 times with the
> duration when the "LockRecord" component
> with transaction level set to "Required Transaction".

> Maybe you can said I can set the transaction level to "Required
Transaction"
> so that I can have faster execution time.
> However, coz I want to let other user can "see" the record insert by the
> "LockRecord" component, so I can only use
> "Required New Transaction", otherwise, other can "see" the records.

> As result, do anyone have any idea to solve it? thx !

> Br,
> Rayman



Mon, 05 Jan 2004 17:45:10 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. To Transaction or Not to Transaction that is the question

2. ADODB TRANSACTION ADO ERROR No Transaction is Active

3. Why to use COM+ transaction and not just SQL Server transaction

4. Cannot connect to the transaction manager or the transaction (-2147168229)

5. ADODB TRANSACTION ADO ERROR No Transaction is Active

6. ADO Connection Transaction vs. ObjectContext Transaction

7. ADOConnection.Transaction vs. ObjectContext.Transaction

8. Transaction In Transaction

9. When to use MTS transactions and ADO Transactions

10. Why to use COM+ transaction and not just SQL Server transaction

11. Error when using transaction=required

12. ADO and Transaction in SQL Server 7.0: The COMMIT TRANSACTION request has no corresponding BEGIN TRANSACTION.

 

 
Powered by phpBB® Forum Software