?
Solved

sequence of sql commands to open,lock,close file

Posted on 2014-01-16
6
Medium Priority
?
509 Views
Last Modified: 2014-01-31
I am looking for a sequence of SQL  commands that will do three things
open a file
lock some range
close the file

I am writing a script and want to run this sequence infinitely to catch some leak in my server code.
What set of SQL commands can cause the above sequence to occur
0
Comment
Question by:perlperl
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 77

Expert Comment

by:slightwv (䄆 Netminder)
ID: 39785762
What database are you using?
0
 

Author Comment

by:perlperl
ID: 39785768
sqllite
0
 
LVL 60

Accepted Solution

by:
Kevin Cross earned 900 total points
ID: 39786048
Are you running transactions?
Here are some notes on locking http://www.sqlite.org/lockingv3.html
As listed in the documentation, INSERT, UPDATE, DELETE usually lock rows; however, note the comment on EXCLUSIVE lock because of full memory cache.

.open command with a file name will close the current database and open the one in specified file; however, in most cases, people usually start SQLite with the database to open:
sqlite <file/database name>

Open in new window

0
 

Author Comment

by:perlperl
ID: 39788363
nope. I am running it from a perl script.
probably i need to connect to datable, insert/delete some rows and close the db connection
0
 
LVL 28

Expert Comment

by:FishMonger
ID: 39789723
You may want to add some debugging code with the help of one or more of the "leak" related modules.

CPAN search for "leak" modules
0

Featured Post

Get proactive database performance tuning online

At Percona’s web store you can order full Percona Database Performance Audit in minutes. Find out the health of your database, and how to improve it. Pay online with a credit card. Improve your database performance now!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Azure Functions is a solution for easily running small pieces of code, or "functions," in the cloud. This article shows how to create one of these functions to write directly to Azure Table Storage.
Your data is at risk. Probably more today that at any other time in history. There are simply more people with more access to the Web with bad intentions.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Six Sigma Control Plans

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question