Programming :: Python / Sqlite - Database Locked Despite Large Timeouts?

Apr 8, 2010

I'm sure I'm missing something pretty obvious, but I can't for the life of me stop my pysqlite scripts crashing out with a database is locked error. I have two scripts, one to load data into the database, and one to read data out, but both will frequently, and instantly, crash depending on what the other is doing with the database at any given time.I've got the timeout on both scripts set to 30 seconds: cx = sqlite.connect("database.sql", timeout=30.0)and think I can see some evidence of the timeouts in that i get what appears to be a timing stamp (e.g 0.12343827e10 1) dumped occasionally in the middle of my curses formatted output screen, but no delay that ever gets remotely near the 30 second timeout, but still one of the other keeps crashing again and again from this. I'm running RHEL5.4 on a 64 bit HS21 IBM blade, and have heard some mention about issues about multi-threading and am not sure if this might be relevant.

Packages in use are sqlite-3.3.6-5 and python-sqlite-1.1.7-1.2.1, and upgrading to newer versions outside of RedHat's official provisions is not a great option for me. Possible, but not desirable due to the environment in general.I have had autocommit=1 on previously on both scripts, but have since disabled on both, and am now cx.commit()ing on the inserting script and not committing on the select script. Ultimately as I only ever have one script actually making any modifications, I don't really see why this locking should ever ever happen

View 3 Replies


ADVERTISEMENT

Programming :: DataBase In Python - Compile .py Files Into A .exe File

Jun 20, 2011

i am new to python programing and i have a couple of ?'s

1- what would i do if i needed to find the closest, bigger number, from a list of numbers when the user types a number in.

2- (windows) i need a program that can compile .py files into a .exe file so that it works on a machine without python it also needs to work with python 3.2.

View 8 Replies View Related

Fedora :: How To Install Sqlite-python

Nov 18, 2009

I am trying to install sqlite-python package in my FC11 machine. I couldn't find an rpm to install.

View 2 Replies View Related

Software :: Unable To Create An RPM That Will Install Python 2.7.1 Along With Sqlite 3.7.3?

Mar 8, 2011

I want to be able to create an RPM that will install python 2.7.1 along with sqlite 3.7.3, MySQL-Python-1.2.3 on a CentOS 5.5 x86_64 host(s) in a directory (e.g. /opt/python2.7). Once that's done, I want to be able to alias the new python binary in .bash_profile so that my developers can begin using it.

I understand 2.7.1 can't be installed on a CentOS host but I've done the above using a shell script successfully. If you search hard enough, I posted my script on line . However, I need to create the RPM for political reasons. Besides placing the source file(s) in the SOURCES directory, what do I need to do in the spec to be able to successfully create an RPM installer?

Please be gentle with me. I've been drinking the Windows cool-aid for most of my IT career so, this is one of my first attempts of becoming a better DevOps Admin.

View 6 Replies View Related

Debian :: Deleting Data Before Specific Date In SQLite Database

Jun 22, 2015

This is a continuation of the post in [URL].... . What has happened is that I have a huge log of 600 MB + and do not know from when the data is in there.

Code: Select all┌─[shirish@debian] - [~/.config/quassel-irc.org] - [9714]
└─[$] ll -h quassel-storage.sqlite                                                                                                   
-rw------- 1 shirish shirish 647M Jun 22 21:15 quassel-storage.sqlite

So I need to know if there is a way to get just the first five or ten entries listed as one can do using head, tail etc. I did try just using head but it was unsuccessful. The second thing would be deleting some days, weeks or months data from the existing sqlite log. I did see URL... but in my case I am deleting old entries in the sqlite log and also do not know if sqlite makes backups of the data or not ?

View 4 Replies View Related

Ubuntu Installation :: Status Database Area Is Locked By Another Process?

Apr 11, 2010

I tried to install java runtime in the terminal, and I got to the 'contract acceptance' page, and I couldn't find a way to accept and move forward, so I just closed the Terminal, killing the process. later, I went to the ubuntu software center, and tried to install java runtime using that. the status for the installation remained at 0% and said "waiting for other software managers to quit". so I exited out of software center. then update manager popped up, asking me to update several things, including installing java runtime.so I hit yes, and it said this:E:dpkg was interrupted, you must manually run 'dpkg --configure-a' to correct the problem

so I ran:
sudo dpkg --configure -a
sudo apt-get update && sudo apt-get upgrade

[code]....

View 2 Replies View Related

Ubuntu Servers :: PhpMyAdmin Not Loading Large Mysql Database?

Apr 27, 2010

I am running Ubuntu 9.10 with Apache, phpMyAdmin and MySQL. Normally phpMyAdmin loads properly, but the other day I created a large database of 6,000+ tables and 1.3 GB of data in the entire database. Now phpMyAdmin loads and shows my different databases, but if I try to open the new large database, it just loads a white page with no content. Does anyone know if I can reconfigure my server so it will be able to show parts of the database?

View 2 Replies View Related

Programming :: Execute SQLite Db Commands From C++?

Jun 10, 2010

Anyone know how to execute SQLite db commands from C++?

View 1 Replies View Related

Programming :: Load Multiple Records Into SQLite?

Nov 19, 2008

I am using SQLite as my database for some portable cross platform applications I am working on with REALBasic as my IDE. I have an old Sybase 8.0 database that I can access via Microsoft Access and thereby extract the data I need from each table.

Now I know I can create .csv files from each table and load them into SQLite using the import tool, but then I can't define the primary key and other field attributes. So the other option is to load each file via SQL.

Now with most SQL editors I can create multiple queries and they will run just fine. But I can't seem to do that with the SQLite interfaces. I can paste multiple queries but I can only run one at a time. And by that I mean I have to click run.

Ummm that's not acceptable since my biggest table contains over 600,000 records. I have the queries all written, that was easy using a simple interface I wrote in Access.

Code:
INSERT INTO tblMeters(recordId,meterId,meterName,meterSerNum,registerSerNum,mxuSerNum,meterType,manufacture,meterModel,readType,groupId,multiplier,rollover,vendorId,xfrmerCode,bldgCode,CATEGORY,energyType,unitOfMeasure,location,access,comments,dateInstalled,dateCalibrate,pipeSizeIn,pipeSizeOut,elecMeterSpecs)

[Code]...

So is there another method I can use? I can't seem to find anything relating to my particular question at the SQLite web site

View 3 Replies View Related

Programming :: Make Python Programs Run Without Entering The Command Python?

Mar 22, 2009

I want to be able to do

sudo ./program.py

instead of always having to do

sudo python program.py

What do I need to change?

View 5 Replies View Related

Programming :: Python - Get Text File Data Into An Array On Python?

Nov 30, 2009

I've already used line split stuff to transform my data into something like this in a text file:

Code:

['1', '1', '3', '20.7505207']
['2', '1', '3', '23.0488319']
['3', '1', '3', '-1.5768747']
['4', '1', '3', '-26.4772491']

[code]....

How can I get this on a python program so I can manipulate it as an array?

View 3 Replies View Related

Programming :: Variable Substitution In Sqlite Open Db Command?

Jun 15, 2010

I have the following TCL code:

if{ [catch {sqlite3 db /path/to/db/file} result] } {
puts stderr $result
} else {
do something
}

What I want is to use a variable for the file name/path. When I put in a variable instead of the absolute path, I get an error: "missing close-brace: possible unbalanced brace in comment while executing"

This is weird because when I run the code with the fully qualified pathname, it works fine. I substitute out the pathname for a variable containing the pathname ($variable) and I get this error.

View 1 Replies View Related

Programming :: SQLite Read, Write, Select, Compare Statements For C++

Jun 9, 2010

I am using C++ with SQLite db in a program that will read read a sub set of records, compare records and write different records to another database. I have a SQLite book, but it only shows examples for the C API. Anyone have code samples in C++ for the following:

Open database
Close
Select *
Read
Write

Or, just show me how to execute a SQL statement with C++ and I can then figure out the various SQL statements I need.

View 5 Replies View Related

Programming :: Python 2.x - Represent The Same In Python 3.x

Mar 4, 2010

I have a function definition in a Python 2.x script which take a tuple as one of its arguments, but 2to3 has no answers nor any of my searching on how to represent the same in Python 3.x

Code:

def blah(self, (string1, string2))

View 4 Replies View Related

Programming :: Totem Python Plugin Programming: Any Signal For Video Mouse Click?

Feb 9, 2011

I want that I click with the mouse on the video, it paused.I notice that there is "BaconVideoWidget" which I guess is the video rendering widget but it don't have signal named "clicked":

Code:
vd = totem_object.get_video_widget()
vd.connect("clicked", vd.hide)

[code]....

View 3 Replies View Related

Programming :: Mutexes Necessary - Gets Locked / Unlocked Each Time One Of The 60 Threads?

Jun 24, 2011

I'm a bit worried about "too many mutexes" in my little curses-based app and would like to get confirmation/opinions that I'm doing this right. I've got an array: int nums[60] I've got 61 threads. 1-60 are doing math on the value in their array index (ie: thread1 increments nums[1], threadN increments nums[N]), then sleep(1) The 61st thread is my curses thread which does a for-loop over the array and prints out all the values to the screen, then sleep(1)

Right now, I've got 1 mutex which gets locked/unlocked each time one of the 60 threads needs to update its array-index with a new value, and the 61st thread locks the same mutex just before the for-loop beings reading the values and unlocks after ending the loop.

My questions:
A) Does the above seem OK? (I know it's ok, cause everything works right now but would like opinions on it)
B) Do I even need the mutexes since 1-60 only ever update their own index and 61 just reads?
C) If I do need the mutex protection, is there a better, more efficient way?

View 11 Replies View Related

Programming :: How To Debug Large Project Using 'GDB'

Jun 21, 2010

I'm using ubuntu 9.04;I want to debug my project that comprises mutiple files.When I cd to the project folder and run the command "gdb rawusb_test",Once I tried the flag -g and changed the line "$(CC) -o $(PROG) $(OBJS) $(LIBS)" to "$(CC) -g -o $(PROG) $(OBJS) $(LIBS)", it didn't work!I want to trace the program "rawusb_test" line by line and see the parameters' values!Could you help me how I should debug this project or how the Makefile should be changed?

View 8 Replies View Related

Programming :: What Database To Use For C++

Jan 27, 2010

What database can I use for c++?,this is my first week programming in c++.

View 14 Replies View Related

Programming :: Python 2.x Vs 3.x

Apr 21, 2010

I'm starting to learn python and I am wondering whether I should start with python 2.x or should I just start learning python 3.x?

View 2 Replies View Related

Programming :: Split / Break Up Large Text File

Feb 18, 2011

I have a large text file with three columns. I'm trying to write a PERL script that splits the file up based on the value of the 3rd column. So every time the third column reads 0, a new file is created and all the data up until the next 0 is found is written to that new file. This should happen over and over until the initial file has been entirely split up.

ex data:
000
2024
2243
2143
96962871
97972878
000
2034
3034
3352

So with the data above, the file would be split into two files:
data_1.txt would contain
000
2024
2243
2143
96962871
97972878

and data_2.txt would contain
230
2034
3034
3352

View 10 Replies View Related

Programming :: Check If There Is Such A Value In The Database

Feb 10, 2010

sql statement. I am trying to check if there is such a value in the database.

Code:
string NewMovie = "ww";
string queryText ;
queryText = "Select * from movie_info WHERE movie_title = '"+ NewTitle +"'";
MYSQL *conn;
conn=mysql_init(NULL);
mysql_real_connect(conn,host,username,password,database,0,NULL,0);
[Code]......

return 0; The problem i am facing is how do i check if the value is found. I read up and found that a query will return a value of TRUE if the query is a success and a FAIL if there is an error. How do i call these values and then based the check on it?

View 1 Replies View Related

Debian :: Frequent Lan Connection Timeouts

Jun 9, 2015

I run a Laptop (Mint 17.1), which is connected to a Debian 8.1 server over a LAN. The systems are connected through a router. Both of them show no problems when working independently and when doing work on the internet. Also, ping works fine (no lost packets, no delays!) from Debian to Mint. However when doing a ping from the Laptop (Mint) to the Debian server, I experience frequent packet losses and timeouts. In fact, a "first" ping may lose the first 20 to 30 "tries". Thereafter, if I repeat pings immediately and quickly one after the other, they might in geral not lose packages or show delays. Ping to and from the router also works perfectly in either direction!

Of course, functions such as ssh or samba-sharing are hampered as well by this behaviour. Also, if I DO in fact manage to connect to the Debian server via ssh, my console (KDE 14) is freuqently "locked" (i.e. - doesn't show my input for a while) but in the end DOES show the characters entered and gets processed o.k. (eg. when doing an "ls"-command). Both systems are at the latest software-level and I just finished installing Debian 8.1. The situation was the same on Debian Wheezy, however.

View 3 Replies View Related

Ubuntu :: Sudo Permissions And Timeouts?

Feb 3, 2010

I want to make a script for something, but I'm worried the timeouts on sudo permissions (how you can't got more than 5/10 minutes between sudo commands before needing your password again). Basically, I don't want my script to be redundant and require overseeing for password inputs.

Code:
sudo echo Hello.
sleep 6000
sudo echo This is text. This shows the basis of the problem. I will need to enter my password twice.

Would allowing it to run uninterrupted be as easy as running this theoretical shell script his sudo to begin with?

View 1 Replies View Related

General :: SuSE Nfs Client RPC Timeouts

Jan 5, 2010

i'm new to linux so bear with me.we have two servers running in a cluster mode. i disable the cluster so that we could install a new os kernel that was provided by our vendor tumbleweed.So the active server which does not have the upgraded os kernel the version is Linux version 2.6.5-7.283-smp (geeko@buildhost) (gcc version 3.3.3 (SuSE Linux)) #1 SMP Wed Nov 29 16:55:53 UTC 2006 for the server which does not have the kernel upgrade, i can mount to netapp mount. however from the server which has it's kernel upgraded, i get a rpc timeout error when i try to mount the drive.

somehow the server which has got the kernel upgrade is trying to use udp. the server goes through a firewall before getting to the netapp server and upd is not allowed.in the fstab entries, i specified tcp,proto=tcp but no matter what values i put in, it's trying to use upd.

View 7 Replies View Related

Server :: Preventing SSH Timeouts - Some Clarification?

Jun 8, 2010

We are seeing some dropped SSH connections because of which some of the process are failing . The main likely reason for the connection drops is that both the client and server remains 100% busy during a certain time interval and during that time interval we see those occassional connection closed by the server.

[Code]...

View 1 Replies View Related

Programming :: Convert Map From Python 2.x To 3.x

Apr 6, 2010

I have an existing line of code from a P2 script that I cannot find a solution to converting to P3:

Code:
for i, x in map(None, list1, list2):
I have found the information about converting the simple case:
map(None,x) becomes list(x)

But my googling was unable to find a solution when more than one iterable exists.

View 2 Replies View Related

Programming :: How To Run Python Script From C

Jan 31, 2010

I have a python script I wrote a while ago and now I would like to call that script from inside C. I know how to do one command from C, but how would you execute an entire script from C, and passing arguments? Like:

Code:

int main(void)
{
python( myprogram(1 2 3) );
}

So I can pass arguments to my script.

View 3 Replies View Related

Programming :: Py_FindMethod In Python 3.1.1

Jan 19, 2010

what the equivalent function in Python 3.1.1 is for Python 2.6.4s:

Py_FindMethod

Be buggered if I can find anything in the doco to say what replaced it or what alternative code may need to be entered to replace it

View 1 Replies View Related

Programming :: Python With Web Development ?

Dec 17, 2010

I have decided to learn python as it seems to be powerful not just for web development (like php) but also a clean powerful language for other puposes.

Q: Can someone suggest a tutorial or book, on learning python (beginner to intermediate) which has as its focus for learning, web development?

In order of preference: 1. Comprehensive, 2. Online, 3. Free

View 2 Replies View Related

Programming :: Creating Database Using C Language

Apr 7, 2011

How to create a database using c language it includes structures, pointers, arrays and switch..

View 4 Replies View Related







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