Subject | RE: [firebird-support] Multiuser Simultaneous INSERT and SELECT queries on Firebird database, |
---|---|
Author | Rick Debay |
Post date | 2006-08-04T16:45:45Z |
If 'i' is supposed to be a primary key, create a trigger on Dummy_tab to
use a generator to create the key for you.
Use whatever the VB.net equivalent of Java's PreparedStatement for your
SQL, instead of having the database recompile a new statement every
time.
-----Original Message-----
From: firebird-support@yahoogroups.com
[mailto:firebird-support@yahoogroups.com] On Behalf Of mauleen2006
Sent: Friday, August 04, 2006 2:54 AM
To: firebird-support@yahoogroups.com
Subject: [firebird-support] Multiuser Simultaneous INSERT and SELECT
queries on Firebird database,
Hello,
I have a problem regarding Multiple users Simultaneous using
INSERT and SELECT queries on Firebird database. The detail problem
scenario is as follows:-
I have a table and multiple users access the table at the same
time. If one user is inserting the data , another user at the same time
fires a select query to get the max no from the same table. Now at one
point my VB.Net application hangs.
Now is it possible to use some type of locking system to lock the data
until one user finishes the insert query and does not allow the select
query to fire until the process is complete.
This is a very urgent requirement.
Please find the code below to understand the problem scenario:-
Code For INSERTING DATA:-
fbcmd = New FbCommand("Insert into Dummy_tab values(" & i &
",'Mauleen')", fbcon)
fbcmd.ExecuteNonQuery()
Code for getting the max no:-
fbcmd = New FbCommand("Select max(id) from dummy_tab", fbcon)
fbcmd.ExecuteScalar()
Thank you
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Visit http://www.firebirdsql.org and click the Resources item on the
main (top) menu. Try Knowledgebase and FAQ links !
Also search the knowledgebases at http://www.ibphoenix.com
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Yahoo! Groups Links
use a generator to create the key for you.
Use whatever the VB.net equivalent of Java's PreparedStatement for your
SQL, instead of having the database recompile a new statement every
time.
-----Original Message-----
From: firebird-support@yahoogroups.com
[mailto:firebird-support@yahoogroups.com] On Behalf Of mauleen2006
Sent: Friday, August 04, 2006 2:54 AM
To: firebird-support@yahoogroups.com
Subject: [firebird-support] Multiuser Simultaneous INSERT and SELECT
queries on Firebird database,
Hello,
I have a problem regarding Multiple users Simultaneous using
INSERT and SELECT queries on Firebird database. The detail problem
scenario is as follows:-
I have a table and multiple users access the table at the same
time. If one user is inserting the data , another user at the same time
fires a select query to get the max no from the same table. Now at one
point my VB.Net application hangs.
Now is it possible to use some type of locking system to lock the data
until one user finishes the insert query and does not allow the select
query to fire until the process is complete.
This is a very urgent requirement.
Please find the code below to understand the problem scenario:-
Code For INSERTING DATA:-
fbcmd = New FbCommand("Insert into Dummy_tab values(" & i &
",'Mauleen')", fbcon)
fbcmd.ExecuteNonQuery()
Code for getting the max no:-
fbcmd = New FbCommand("Select max(id) from dummy_tab", fbcon)
fbcmd.ExecuteScalar()
Thank you
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Visit http://www.firebirdsql.org and click the Resources item on the
main (top) menu. Try Knowledgebase and FAQ links !
Also search the knowledgebases at http://www.ibphoenix.com
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Yahoo! Groups Links