• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 547
  • Last Modified:

sequence of sql commands to open,lock,close file

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
perlperl
Asked:
perlperl
1 Solution
 
slightwv (䄆 Netminder) Commented:
What database are you using?
0
 
perlperlAuthor Commented:
sqllite
0
 
Kevin CrossChief Technology OfficerCommented:
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
 
perlperlAuthor Commented:
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
 
FishMongerCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to Squarespace.com and use offer code ‘EXPERTS’ to get 10% off your first purchase.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now