Eugen
Eugen

Reputation: 2990

Block access to database

I have a client app that works with a huge 1 table from a given database and insert some statistical data into another 10 tables. To prohibit usage of the database by other applications I transfer it to single user mode. All works ok, but having only 1 connection is taking a long time to process and insert all the data. If I use multiple threads and multiple connections without 'single user mode' the time is cut about 5 times. The question is, is there another way that would block access to the database by other applications, but allowing at the same usage of multiple connections from my application?

Upvotes: 0

Views: 219

Answers (2)

Michael Harmon
Michael Harmon

Reputation: 746

How about using a Logon Trigger? Create a table with user names that are allowed to Logon. If the user is not in the table, roll them back so they cannot Logon.

Michael Harmon

Upvotes: 1

Emond
Emond

Reputation: 50692

You could introduce a layer in between the clients and the database.

The layer could keep track of the clients and allow only one to access the database for the transfer.

The layer would be the only process allowed to access the database directly.

Upvotes: 0

Related Questions