ODBC And Record Locking

Mar 15, 2007

I found this interesting paper at http://ftp.sas.com/techsup/download/v8papers/odbcdb.pdf, comparing OLEDB to ODBC.

It says that OLEDB provides record locking where ODBC doesn't. I can't quite reconcile that statement; what does it mean? How is the access layer involved in determining type of locks used by the server in executing a statement?

.B ekiM

View 3 Replies


ADVERTISEMENT

Query Timeouts When Updating A Record Retrieved Through A Websphere JDBC Datasource - Possible Record Locking Problem

Apr 7, 2008

Hi,

We're running a Sage CRM install with a SQL Server 2000 database at the back end. We're using the Sage web services API for updating data and a JDBC connection to retrieve data as it's so much quicker.

If I retrieve a record using the JDBC connection and then try and update the same record through the web services, the query times out as if the record is locked for updates. Has anyone experienced anything similar or know what I'm doing wrong? If I just use DriverManager.getConnection() to establish the connection instead of the datasource, and then continue with the same code I don't get these record locking problems. Please find more details below.

Thanks,
Sarah

The JDBC provider for the datasource is a WebSphere embedded ConnectJDBC for SQL Server DataSource, using an implementation type of 'connection pool datasource'. We are using a container managed J2C authentication alias for logging on.

This is running on a Websphere Application Server v6.1.

Code snippet - getting the record thru JDBC:


DataSource wsDataSource = serviceLocator.getDataSource("jdbc/dsSQLServer");
Connection wsCon = wsDataSource.getConnection();


// wsCon.setAutoCommit(false); //have tried with and without this flag - same results

Statements stmt = wsCon.createStatement();


String sql = "SELECT * FROM Person where personID = 12345";
ResultSet rs = stmt.executeQuery(sql);


if(rs.next()){
System.out.println(rs.getString("lastName"));
}

if (rs != null){
rs.close();
}
if (stmt != null) {

stmt.close();
}
if (wsCon != null) {

wsCon.close();
}

View 1 Replies View Related

MSSQL 2000, ODBC, Tempdb, Locking

May 14, 2002

Hi, I wonder if anyone can shed some light on this issue -

We have a client/server program for MSSQL7 and MSSQL2000.
When running client/server - we have our own broker, etc,
the program ends up locking itself on SQL2000; this is not a problem on SQL7.
We noticed that it seems some system tables locking tempdb.
We also noticed that SQL2000 no longer has insert-into/bulkcopy option like SQL7. But, here we don't have temporary tables at all. It's just that we found the lockings in tempdb caused by some sysobjects, sysindexes, etc.
Also, this does not happen to all the systems we have. Some of our machine does not have the self-lock problem; most of the machines have this problem though.

If we don't run client/server, then the program works fine.
Same logic, the difference is when we use client/server logic to connect to the remote SQLServer 2000 server, the locking might happen on most of our machines.

Anyone is familiar with tempdb and locking issues, please provide some hint??? Is it possible that there are some system parameters that we can set to avoid the problem. We haven't found out why some of our machines do not have problem, while most of the machines have this locking problem.

The program is written using ODBC.

Many thanks in advance.

HIBA International

View 2 Replies View Related

Record Locking

Oct 5, 2000

Hello,

I need help in record locking. As soon as user retrieve records I want to lock those records in database. When other user try to retrieve records from the same table i want to retrieve records those are not locked by other user. How do I do this? Please help...

Thanks in a millian.

Sarika

View 1 Replies View Related

Record Locking

Jul 26, 2001

Hello,

I have a database programmer who in his latest application has deployed manual record locking into code to release certain records to certain users of the application at specified times.

Does anyone know how manual record locking will affect the SQL 2K system? If at all? Are there some standard practices with manual record locking that should be enforced?

Thanks,
Brent.

View 3 Replies View Related

Need Help: Record Locking

Sep 7, 2007

Project spec:
If user is making Delivery Order for sales order,
the other user cannot make Delivery order for same sales order

How to lock a sales-order record, so other user cant use it, except for reporting (read only). I dont want to use a field since it has a lot of weakness. I am using VB6 and connect with ADO

Thanks

View 3 Replies View Related

Record Locking In ADO.net/Sql Server

Feb 18, 2005

Currently I am working on asp.net Intranet system.I need some suggestion on records locking for Sqlserver & ASP.net.
I want to prevent two user to open the same record for modify.Means if some one has open one record (id=xxxxx) for modify then others should not be able to open same same record (id=xxxxx) for modify .otherwise if both user will open/update same record then information in database will not be updated correctly.
Any idea how we can do the record locking so that not two users can open same record(id=xxxxx) for modify.

Thanks in Advance
Arvind

View 2 Replies View Related

How To Do The Record/row Level Locking In SQL 6.5/7.0?

Jan 3, 2000

I am writing a VB program, which needs to update record A in one table using transaction control (BeginTrans & CommitTrans). But due to the page-level locking, before the "CommitTrans", other users couldn't not read other records in the same table.

Is there any way that I can do the record/row level locking? If possible, could you provide me some VB source code? Such as how to use "DBCC ROWLOCK" or how to set for row-level locking.

Thanks for your kind help.

View 1 Replies View Related

Another Record Locking Issue...

Nov 15, 2004

Hi all,

I'm working on a Planning Databse for a factory that allows jobs to be allocated to machines and to be given a priority. This info. is displayed on an Access 2000 form e.g.

MACHINE ONE MACHINE TWO
Priority Job Number Priority Job Number
1 J111 1 J654
2 J562 2 J865
3 j231 3 J821

Both the Production Manager and the Factory Manager have this form open at all times. The problem is this, if for example the Factory Manager changes the priority of a job on his PC, the change is not shown on the Production Managers PC (cos' his screen has not been refreshed with update) The Production Manager therefore has old data on his screen and could mistakenly think that the job priority had not changed at all...
I have managed to write some VBA code to get round this but I was wondering if there was any way of 'pushing ' changes to the front-end when they are made or of using record-locking etc. to achieve the same affect...

Thanks
M

View 6 Replies View Related

SQL/Acces Record Locking

Dec 9, 2005

I am running an Access 2000 front end and MS SQL2000 as a backend and I am having problems with record locking.

I have just found out that If you use ODBC then Access acts as if No Locks are set. In an ideal world I need the record to be locked by a user as soon as they move onto it. If not as soon as they start editing it?

Cheers.

View 2 Replies View Related

Record Locking Bug/Issue

May 3, 2006

Hi there,

Up until this point I've been quite lazy in trying to understand how record locking really works in SQL server however one of my applications now has a bug so the time has come for me to take the issue seriously.

Basically, a user clicks a button in my app and updates a field in a table in SQL Server (say at 10:34:55). At the almost exactly the same time (lets say 10:34:57) another user tries to update the same record (not necessarily the same field) but the second users update is not connected to the database.

How can I store the second users update and then commit to database once the first user is finished...is it possible or do i need to approach this from a different angle?

Thanks

View 5 Replies View Related

Record Locking In Access ADP

Jul 23, 2005

I'm trying to figure out what happened.I have have two Tables in SQLServer called "Contacts", and "Jobs"Whenever someone changes a record in either table I update two fieldscalled "Modby" and "Moddt" with a trigger. The Trigger may alsocontain other things as well.Here's the wierd thing.If the Modby Moddt statement is the first statement in the trigger Idon't get a "record changed by another user" but if it comes later inthe trigger I do.I think it has something to do with the LockDelay Key but I'm not sure.Any Ideas?

View 3 Replies View Related

Locking An MSSQL Record With ADO.NET

Jul 23, 2005

Is there a way using ADO.NET to lock a record so that you can performan atomic Test and Set operation on one of its fields?I want to set an application level lock bit on a record's field (set itfrom 0 to 1) and at the same time determine that it was 0 before Ibegan and that I was the one who set it to 1, or that it was 1 before Igot to it (and thus I do not own the lock to the record).I don't see anything that explains if this can be done using ADO.NETusing MSSQL. Any help is greatly appreciated.

View 3 Replies View Related

Single Record / Row Locking

Aug 16, 2007

From SQL Server Books Online, there is a topic: Concurrency Effects, and did mention the following side effects:

- Lost updates.
- Uncommitted dependency (dirty read).
- Inconsistent analysis (nonrepeatable read).
- Phantom reads.

Can someone please tell me which type of Isolation Levels in the Database Engine to avoid the above side effects respectively.

For Record Locking issue:
Example, two editors make an electronic copy of the same document. Each editor changes the copy independently and then saves the changed copy thereby overwriting the original document. The editor who saves the changed copy last overwrites the changes made by the other editor.
This problem could be avoided if one editor could not access the file until the other editor had finished and committed the transaction.

For the above example, is it possible to do like this way:
Editor 1: SELECT and Lock a record
Editor 2: Before SELECT the record, check for the record whether it is locked or not. If it is not lock, then the record can be selected

Please advise.

Thanks.


View 2 Replies View Related

What Is The Most Effective Method Of Record Locking?

Feb 25, 2004

I have built my own functions in the past that involve a timestamp and record lock column in each table (to support some other DB).

I am currently using SQL 2000 and was wondering if there is a better (OK, easier) way to lock records and even prevent edits from taking place when a record is open.

Any input appreciated.

View 25 Replies View Related

P2P Transactional Replication And Record Locking

Jul 15, 2007

I've been considering implementing a P2P Transactional Replication concept using three different sites. My qustion is:

Instead of have records only available for editing by specific sql servers (partitioning), can I implement some sort of record locking? For exampel all sql nodes have r/w access to all data unless one sql node has the record locked?

View 1 Replies View Related

Tricky Record Locking Problems

Jul 20, 2005

I have a problem with record locking / blocking within an application.The app is quite straight forward. Written in Delphi 5 using BDE toaccess a SQL 7 database (Win2K server).Every so often the users (when they bother to tell me) find that theapplication locks up and they are unable to work. No errors areproduced (error trapping in the app is good). They 'shout round' toeach other and get someone to exit the data entry screen. This seemsto free up the locking/blocking issue.There are about 50,000 records in the table (script below) and it isaccessed through a simple query (script below). All users will accessthis in the same way. I'm assuming that a new record is being editedwhen the problem occurs, but this shouldn't cause locking/blockinguntil it gets committed (right ?).The problem is tracking down the source of this and finding thepattern which I can work back from. I've used Erland's aba_lockinfoscript (a few months back admittedly so will re-visit this), butnothing obvious is jumping out at me.No other tables should be in use at this point.Any suggestions ?ThanksRyan/* Code for query component - users navigate to the record they needto editthere could be 15,000 records showing as outstanding - perhaps thisis the area that I need to re-visit so that less records can be edited? */SELECT *FROMPostReceivedWHEREToDelete = 0 ANDCompleted <> 1ORDER BYPostID/* Table in question */if exists (select * from sysobjects where id =object_id(N'[dbo].[PostReceived]') and OBJECTPROPERTY(id,N'IsUserTable') = 1)drop table [dbo].[PostReceived]GOCREATE TABLE [dbo].[PostReceived] ([PostID] [int] IDENTITY (1, 1) NOT NULL ,[Type] [varchar] (100) NULL ,[ClientsName] [varchar] (100) NULL ,[DateReceived] [datetime] NULL ,[EnteredBy] [varchar] (100) NULL ,[AssignedTo] [varchar] (100) NULL ,[DateAssignedTo] [datetime] NULL ,[Adviser] [varchar] (100) NULL ,[TargetDate] [datetime] NULL ,[CompletionDate] [datetime] NULL ,[Completed] [bit] NULL ,[KeyAccount] [varchar] (100) NULL ,[Notes] [text] NULL ,[Specific1] [varchar] (20) NULL ,[Specific2] [varchar] (20) NULL ,[Specific3] [varchar] (20) NULL ,[Specific4] [varchar] (20) NULL ,[Specific5] [varchar] (20) NULL ,[ToDelete] [bit] NULL ,[EnterUser] [varchar] (20) NULL) ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]GO

View 3 Replies View Related

To Get An Unique Sequence Number (record Locking)

Aug 27, 2007

can someone pls show me a way to get an unique sequence at below senario:

PC1 & PC2 using their own local client progam to access to Database Server at SERVER1.
In the SERVER1, there is a table SEQUENCE in a database DATABASE1.
And the table's structure of SEQUENCE are SeqType & SeqNo.
Here is the sample data:

SeqType SeqNo
Invoice 100
DeliveryOrder 200

Now, how to prevent PC1 & PC2 to get a same Invoice No. if they request the Invoice No. at the same time?
Is it possible to lock the record Invoice when i perform a SELECT statement, then i update the Invoice to 101, lastly release the lock for Invoice?

pls advise. thanks.

View 1 Replies View Related

OLEDB Provider For DB2 - Record Locking &&amp; Open Sessions

Feb 13, 2008

We have a linked server configured on our SQL Server 2005 server that points to our iSeries. A step in a scheduled job successfully updates data in tables on the iSeries using an update query and the 4-part naming convention (job reports success and updates can be verified), but it appears to leave locked records and open connections on the iSeries. No open sessions showing in SQL Activity Monitor.

The linked server is configured using Microsoft's OLEDB Provider for DB2. Are there additional settings that can be configured on the linked server to prevent this behavior or is this an issue that need needs to be addressed on the iSeries? A timeout setting perhaps (not sure if this fixes the record locks though)?

Any help is greatly appreciated.

KS

View 2 Replies View Related

Odbc Error - Record Has Been Changed By Another User

Oct 9, 2001

The following error is recieved when updating a record using access 97 and odbc driver to an oracle database.

This record has been changed by another user since you started editing it. If you save the record, you will overwrite the changes the other user made.

Any help is greatly appriciated.
Thanks in Advance

View 1 Replies View Related

ODBC Call Fail/Record Locked

May 3, 2004

I have recently moved some native Access tables to SQL Server 7. These tables are updated in code. When the update is done via a SQL statement, I get
"This record is being modified by another user. . . Save, Copy to Clipboard, Drop Changes"

When the record is being updated via DAO code, I get,
"ODBC Call Fail"

Both errors are most irritating and I desperately need to find a way around this. Any suggestions would be greatly appreciated.

Crystal

View 1 Replies View Related

Attempt To Return Record Set In INSERT...EXEC Statement From ODBC Source(non MSSQL)

Jan 17, 2007

Greeting.

I use OdbcConnection inside clr procedure, for getting data. If I use simple EXEC dbo.clr_proc - all is OK. If I use INSERT...EXEC I recive error message: Distributed transaction enlistment failed.

I set MSDTC security options for No Authentification and Allow inbound and Allow outbound, but it's no use.

Have this problem solution? May be, I must use another method to get my data?



P.S. Linked Servers and OPENQUERY is not applicable. Sybase not describe columns in stored proc result set and one stored proc may return different result set by params.

P.S.S. Sorry for bad english.









View 1 Replies View Related

Integration Services :: Unable To See 64bit ODBC Driver From SSIS Odbc Connection?

Jun 1, 2015

I am using SSIS 2014 with the below .net framework version and installed in Windows server 2012 R2 . I have installed my client's odbc drivers (both 32 bit and 64 bit) in my production server and created ODBC system DSNs for 32 bit and 64 bit.

When i open SSIS 2014 and tried to create the odbc connection but i can able to see only the 32 bit system DSN connection ,i can't able to see my 64 bit odbc system dsn connection.

Microsoft Visual Studio 2012 Shell (Integrated)
Version 11.0.50727.1 RTMREL
Microsoft .NET Framework
Version 4.5.51650

SQL Server Integration Services   
Microsoft SQL Server Integration Services Designer
Version 12.0.1524.0

And i installed my client odbc drivers(32,64 bit) and created ODBC system DSNs in my local system and when i open ssis 2014 and i can able to see both the ODBC system DSNS(32,64) connections from SSIS ODBC connection.

I am using below version of .net framework in my local system which was installed in windows 7 and i have SSIS 2012 also installed in my system and i can able to see both ODBC connections using 2012 as well in my local system.

Microsoft Visual Studio 2012 Shell (Integrated)
Version 11.0.50727.1 RTMREL
Microsoft .NET Framework
Version 4.5.50938

SQL Server Integration Services   
Microsoft SQL Server Integration Services Designer
Version 12.0.1524.0

why i can not see the ODBC 64 bit system DSN connection from SSIS in my production server ?

View 9 Replies View Related

How Can I Use Create Or Alter Statements With ODBC And Microsoft Access ODBC Driver (*mdb)?

May 13, 2007



Hi,



I am using VB.NET 2005 and set up an ODBC connection via ODBC.ODBCConnection to a MDB database. Therefor, I use the "Microsoft Access ODBC Driver (*.mdb)".



When I set up a ODBCCommand like "ALTER DATABASE..." or "CREATE TABLE..." and issue it with the com.ExecuteNonQuery() command, I get an error from ODBC driver, that a SQL statement has to begin with SELECT, INSERT, UPDATE or DELETE.



How can I use DDL statements via ODBC?



I would appreciate if you could help me to use ODBC for that - no OLE, no ADO.



Thanks for help!



Regards,

Stefan D.

View 14 Replies View Related

Can't Find SQL Native Client In ODBC Connection Manager In SQL Server Open Database Connectivity (ODBC)

Feb 13, 2007

I apologize if this is not the correct forum for this posting. Looking at the descriptions, it appeared to be the best choice.

I am running Windows XP Pro SP2. I have installed the SQL Native Client for
XP. However, when I try to add a new data source through ODBC Connection
Manager, SQL Native Client is not listed as an option. I have followed this procedure on three other systems with no problems. What would be causing the
SQL Native Client to not show up in the list of available ODBC data sources?

View 4 Replies View Related

MS OLE DB For ODBC With Oracle ODBC Source Headaches

Dec 25, 2005

Hi all,I am having trouble getting linked Oracle 9 server in MS SQL Server2005 Express to work properly. My machine is running Windows XP.The Microsoft and Oracle OLE DB Providers have problems dealing withOracle's Numeric Data Type, so I decided to use Microsoft's OLE DB forODBC Provider and an Oracle ODBC source. When using the Microsoft ODBCfor Oracle Driver in my ODBC source I have inconsistent behavior.Sometimes my queries are processed properly, then other times I get thefollowing errorOLE DB provider "MSDASQL" for linked server "ODBCBEAST" returnedmessage "[Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttrfailed".OLE DB provider "MSDASQL" for linked server "ODBCBEAST" returnedmessage "[Microsoft][ODBC Driver Manager] Driver's SQLSetConnectAttrfailed".OLE DB provider "MSDASQL" for linked server "ODBCBEAST" returnedmessage "[Microsoft][ODBC driver for Oracle][Oracle]".Msg 7303, Level 16, State 1, Line 1Cannot initialize the data source object of OLE DB provider "MSDASQL"for linked server "ODBCBEAST".I have no idea why sometimes I can connect to the linked server with noproblems andwhy other times it performs like this. I'm not changing anything aboutthe system I can think of. When I use an Oracle client (PL/SQL) I haveabsolutely no problems connecting. TNSPING returns that the connectionis good.This is unacceptable so I decided to try my luck with the Oracle 10gODBC driver. However when I use this and perform an openquery selectagainst the linked server I get back only 11 rows, when I know that thedatabase has over 100 rows (in fact when using the Microsoft ODBCdriver and it works that's what I get). I figured maybe the buffersetting needed to be raised in the ODBC configuration so I took it from64000 to 600000 (a magnitude of 10) but I still get back only 11 rows.I'm at my wit's end.Any suggestions on resolving one or the other problem would be muchappreciated.Thanks much

View 2 Replies View Related

TOUGH INSERT: Copy Sale Record/Line Items For Duplicate Record

Jul 20, 2005

I have a client who needs to copy an existing sale. The problem isthe Sale is made up of three tables: Sale, SaleEquipment, SaleParts.Each sale can have multiple pieces of equipment with correspondingparts, or parts without equipment. My problem in copying is when I goto copy the parts, how do I get the NEW sale equipment ids updatedcorrectly on their corresponding parts?I can provide more information if necessary.Thank you!!Maria

View 6 Replies View Related

How To Create An Copy Of A Certain Record Except One Specific Column That Must Be Different &&amp; Insert The New Record In The Table

Sep 1, 2006

Hi
I have a table with a user column and other columns. User column id the primary key.

I want to create a copy of the record where the user="user1" and insert that copy in the same table in a new created record. But I want the new record to have a value of "user2" in the user column instead of "user1" since it's a primary key

Thanks.

View 6 Replies View Related

Ways To Make This Work: Several Selectable Related Record For One Main Record.

Apr 6, 2007

Hey all!



Sorry for the less then descriptive post title but I didn't find a better way to describe it. I'm developing an app in the express editions of VB and SQLserver. The application is a task/resource scheduler. The main form will have a datepicker or weekly overview and show all tasks scheduled per day. The problem is, I've got one or more people assigned to tasks and I wonder what's the best way to design this. Personally, I'd go for one Task table, a People table and a table that provides a link between them (several record per task, one for each person assigned linking TaskID and PplID). However, I don't see a nice way of showing this data to the end user, allowing him to edit/add etc on ONE screen.

To fix that the only way I see is just add columns to the Task table for every person with select boxes. This way everything can be done on one simple screen. This obviously does present some future issues.

On top of this, which people are available on a day varies and there should be an option to allow a user to set who is available on a specific day. Which would lead me to my first idea and add another table that would provide this. but then I'm having design issues again for the form.



I'm kinda stuck atm, can anyone shed some light on this. I'm sure there is an elegant way of doing this but I'm failing at finding it.



Thanks in advance,

Johan

View 5 Replies View Related

SSIS: Multi-Record File Extract With 9 Record Types

Feb 26, 2008

I am attempting to create a multi-record file (as described in my last thread) and have found the following set of instructions very helpful:
http://vsteamsystemcentral.com/cs21/blogs/steve_fibich/archive/2007/09/25/multi-record-formated-flat-file-with-ssis.aspx

I have been able to create a sample file with two of my record types.

I now need to build on this further, because I have 9 record types in total that need to be extracted to a single flat file.

does anyone have any ideas how I might extend the example above to include more record types or know of another means of achieving this?

Thanks in advance for any help you might be able to provide.


View 3 Replies View Related

Compatible Versions Of Ms SQL Server, ODBC Driver, Driver Manager And ODBC API Spec

Oct 28, 2004

Hi,

Please help share with me if you know the version compatibility matrix of Ms SQL Server, ODBC driver (sqlsrv32.dll), Driver Manager (odbc32.dll) and ODBC API spec. For instance, how can I know Ms SQL Server 2000 can work with which version of sqlsrv32.dll, a particular version of sqlsrv32.dll can work with which version of odbc32.dll and a certain version of sqlsrv32.dll/odbc32.dll conforms to which version of ODBC API spec (e.g. 3.5).

Any help will be appreciated.

Thanks,

vtluu.

View 1 Replies View Related

Add Date To Record In SQL Server Each Time Record Is Added

Mar 1, 2006

Hi
 
Can anyone advise me as to how I can add the date and time to 2 columns in the sql server database for each record that is added. I'd prefer not to use the webform. Can sql server add the date automatically to the row?
thanks

View 6 Replies View Related

Restrict Inserting Record If Record Already Exist In Table

Apr 17, 2014

Is that possible to restrict inserting the record if record already exist in the table.

Scenario: query should be

We are inserting a bulk information of data, it should not insert the row if it already exist in the table. excluding that it should insert the other rows.

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved