|
Hey guys,
QUESTION 1: Is this correct?
I. Transaction Isolation Level Serializable = Pessimistic Locking
For example:
trx = conn.BeginTransaction(IsolationLevel.Serializable)
ie. When two threads try to access the same record..
1. Thread 1 begins tran and select [record 123] (I presume a X-lock *Exclusive lock* is acquired)<br />
2. Thread 2 begins tran and *attemp* to select [record 123] (but must wait before select comes thru because Transaction Isolation is set to Serializable -- ie. pessimistic -- I presume Thread 2 is also trying to acquire X-lock at this time but need to wait)<br />
3. Thread 1 commit updates on [record 123]<br />
4. Thread 2 select on [record 123] comes thru <br />
5. Thread 2 update<br />
6. Thread 2 commits update<br />
II. Transaction Isolation Level = ??? For optimistic locking?
<br />
1. Thread 1 begins tran and select [record 123] (I presume a S-lock *shared lock* is acquired)<br />
2. Thread 2 begins tran and select [record 123] and it comes thru (Thread 2 also acquire a S-lock at this point)<br />
3. Thread 1 commit updates on [record 123 \ file updated: firstname] (Thread 1 acquired a U-lock *update lock* at this point)<br />
4. Thread 2 commit updates on [record 123 \ file updated: lastname] (CAUTION: firstname commited by Thread 1 overwritten by Thread 2 at this time) (Thread 2 acquired a U-lock *update lock* at this point)<br />
Is this correct?
QUESTION 2:
With cursor you get to specified locking, for example:
<br />
Dim objRs As ADODB.Recordset<br />
Set objRs = New ADODB.Recordset<br />
<br />
Or Dim Objrs As New Adodb.Recordset<br />
<br />
objRs.Open "users", objConn, adOpenKeyset, adLockOptimistic, adCmdTable
But how with ... "System.Data.IDbConnection"?
Thanks in advance.
-- modified at 23:37 Thursday 1st September, 2005
|
|
|
|
|
What DBMS you have ?
Level of isolation may differ from theory to a specific DBMS or
from a DBMS to another DBMS !
---
object oriented
uml oriented
iconix oriented
sql oriented
truespace oriented
---
solitare oriented
|
|
|
|
|
say, Microsoft SQL Server?
|
|
|
|
|
1) ok
2) Try use SQL Server SET command like this: SET TRANSACTION ISOLATION LEVEL SERIALIZABLE for example
---
object oriented
uml oriented
iconix oriented
sql oriented
truespace oriented
---
solitare oriented
|
|
|
|
|
No, there seems to be distinction between "Data Isolation (Serializable/Repeatable Read/Read Committed/Dirty)" and "Optimistic (or Pessimistic) Locking"...
In my post I was asking:
"Serializable" corresponds to "Pessimistic locking" --> Now, for "Optimistic locking", which level of data isolation does it correspond to? Repeatable Read?
Norman Fung
|
|
|
|
|
HOW I KNOW WHAT TABLES ARE IN A DATA BASE
PLEASE HELP ME.
I KNOW THE ARE A DATA BASE PRINCIPAL IN SQL SERVER WHIT CONTAINS ALL DATA BASE NAMES AND TABLES CONTAINS
|
|
|
|
|
|
You could look in the table sysobjects (or this may be different if you are using a different database type)
'--8<------------------------
Ex Datis:
Duncan Jones
Merrion Computing Ltd
|
|
|
|
|
STOP YELLING !!!
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
What is the database that you are using.
Assuming its SQL Server
To get an *approximate* count for all tables, you can use the following:
SELECT
[TableName] = so.name,
[RowCount] = MAX(si.rows)
FROM
sysobjects so,
sysindexes si
WHERE
so.xtype = 'U'
AND
si.id = OBJECT_ID(so.name)
GROUP BY
so.name
ORDER BY
2 DESC
|
|
|
|
|
SELECT
[TableName] = so.name,
FROM
sysobjects so
WHERE
so.xtype = 'U'
ORDER BY
so.name
|
|
|
|
|
got a problem:
table(with names A, B):
A B
----------
1 Hallo
1 wie geht es dir?
2 schlecht!
3 nein,
3 eigentlich gut!
I want the result:
A B Resultat C
-------------------------------------------
1----Hallo----------------
1----wie geht es dir?-----Hallo wie geht es dir?
2----schlecht!------------schlecht!
3----nein,----------------
3----eigentlich gut!------nein, eigentlich nicht
Thank`s for helping!!!
nico
|
|
|
|
|
Try this:
First) You must create a "user defined function" (T SQL function)
like this
CREATE FUNCTION SSum (@a INT) //SSum = string sum
RETURNS NVARCHAR(255) AS
BEGIN
DECLARE @ssum NVARCHAR(255)
DECLARE @b NVARCHAR(25)
SET @ssum = ''
DECLARE crs CURSOR FOR SELECT B FROM table WHERE A = @a
OPEN crs
FETCH NEXT FROM crs INTO @b
WHILE( @@FETCH_STATUS = 0 )
BEGIN
SET @ssum = @ssum + '-' + @b
FETCH NEXT FROM crs INTO @b
END
CLOSE crs
DEALLOCATE crs
IF( LEN(@ssum) != 0 )
SET @ssum = SUBSTRING(@ssum,2,255)
RETURN @ssum
END
Second) Build a SELECT query using SSum function like this:
SELECT DISTINCT A , dbo.SSum(A) AS Result
FROM table
---
object oriented
uml oriented
iconix oriented
sql oriented
truespace oriented
---
solitare oriented
|
|
|
|
|
Hi,
I have .MDF ,SQL server DB files.
How to import those data or how to open .MDF files to the sql server or any other DB .
Pls help
Ram
|
|
|
|
|
Just install a copy of SQL Server or MSDE and attach database files with sp_attach_db system stored procedure.
If you use MSDE and you don't have Enterpreise Manager you may use
osql or isql
commnad prompt tool.
object oriented
uml oriented
iconix oriented
sql oriented
truespace oriented
---
solitare oriented
|
|
|
|
|
hey i would like to "trigger" methods on a remote pc when my database changes(update occurs) the remote program is my GUI and the methods get the info from the database. How would i program this? would i need to write a smll app on the sql server and then let it some how call the remote methods or trigger them? please include code as i dont know anything. v new to coding in C#.
thanks
|
|
|
|
|
|
Be carefull if using sp_OACreate to run a COM component. ActiveX dll's typically run in process which means they are running in the same memory as your database. A badly written dll is likely to corrupt memory in the SQL Server environment which could be containing some of your data. Although you can get it to run out of process it is not an easy thing to set up. An ActiveX.exe will run out of process by default.
Jon
|
|
|
|
|
Hello,
I am developing an application where I need to load custom data to Analysis Server (MS-OLAP) without going through any OLE DB
Provider. I am able to load data into dimensions/cubes using Microsoft OLE DB provider for ODBC Drivers. But my requirement is loading data at runtime from a buffer. Is there any way to do this? Are there any APIs which can help me to load this data directly?
Thanks & regards,
|
|
|
|
|
I found many articles in web and feel it is not clear for connect Oracle 9i later with .net framework 2.0 beta 2.
Some namespace like OracleClient could not be used,and new System.Data.Common does not have examples.
The ODP.NET seems need to download some libary.After downloading a lib writen at 2002, the vs.net 2005 does not has any change.
Could you show me some examples?
Thanks a lot!
|
|
|
|
|
Hi!
One possibility is to use an oleDBConnector (using System.Data.OleDB).
OleDBConnection oleDdCon = new OleDbConnection("Provider=OraOLEDB.Oracle;Data Source=" + sDataSource + ";User ID=" + sUserID + "; Password=" + sPWD);
oleDBCon.Open();
-- modified at 7:49 Wednesday 14th September, 2005
|
|
|
|
|
Hi, I'm still new to sql server 2005 express integrated with VS.NET 2005 Beta 2. I'd like to import my data from Access into my newly created table in sql server 2005 express. How can I do so? Thank you so much.
KiT
|
|
|
|
|
What you like/dislike at OODBMS ?
What you want from a OODBMS ?
object oriented
uml oriented
iconix oriented
sql oriented
truespace oriented
---
solitaire oriented
|
|
|
|
|
how to change the permits on a data base in csharp
|
|
|
|
|
Check if your database management system suport GRANT / REVOKE
SQL commands !
|
|
|
|