Re: [Imdbpy-devel] Bug: imdbpy2sql.py and DB2 9.5

2008-11-28 Thread Joachim Selke
Davide Alberani wrote: >> I disabled it and did executed "COMMIT" every 1000 inserts. It >> makes the thing slightly faster (around 10--20%) but not much. > > I hoped for better performances, on DB2 - but I fear we're not > using it properly. :-) I'm not sure whether there is a way to improve sig

Re: [Imdbpy-devel] Bug: imdbpy2sql.py and DB2 9.5

2008-11-28 Thread Davide Alberani
On Nov 28, Joachim Selke <[EMAIL PROTECTED]> wrote: > I disabled it and did executed "COMMIT" every 1000 inserts. It > makes the thing slightly faster (around 10--20%) but not much. I hoped for better performances, on DB2 - but I fear we're not using it properly. :-) > I changed this to VARCHAR(

Re: [Imdbpy-devel] Bug: imdbpy2sql.py and DB2 9.5

2008-11-28 Thread Joachim Selke
Davide Alberani wrote: > When you've time, you can try to find a way to make transactions > work using the -e command line option; the --sqlite-transactions > option does the equivalent of: > -e 'BEFORE_EVERY_TODB:BEGIN TRANSACTION;' -e 'AFTER_EVERY_TODB:COMMIT;' -e > 'BEFORE_INDEXES:BEGIN TRANS

Re: [Imdbpy-devel] Bug: imdbpy2sql.py and DB2 9.5

2008-11-21 Thread Davide Alberani
On Nov 21, Joachim Selke <[EMAIL PROTECTED]> wrote: > I tried it but there is no SQL command "BEGIN TRANSACTION" in > DB2. The DB2 equivalent is called "BEGIN COMPOUND" -- but it seems > it is used in a different way; just replacing this in your code is > not enough. When you've time, you can try

Re: [Imdbpy-devel] Bug: imdbpy2sql.py and DB2 9.5

2008-11-21 Thread Joachim Selke
Davide Alberani wrote: > May be you can gain some (a lot?) of speed using transactions; you > can try the imdbpy2sql.py option "--sqlite-transactions": it was > thought for SQLite (and will issue a warning if used with another > server, but ignore it). I tried it but there is no SQL command "BEGIN

Re: [Imdbpy-devel] Bug: imdbpy2sql.py and DB2 9.5

2008-11-20 Thread Davide Alberani
On Nov 20, Joachim Selke <[EMAIL PROTECTED]> wrote: > > Fixed. Now it's all to see if IMDbPY has decent performances > > on a DB2 server... :-) > > After running for about 8 hours, Ohhh... a little too much. :-( It should be _all over_ in 4 or 5 hours, even on an outdated/busy computer. May be

Re: [Imdbpy-devel] Bug: imdbpy2sql.py and DB2 9.5

2008-11-20 Thread Joachim Selke
Davide Alberani wrote: > Fixed. Now it's all to see if IMDbPY has decent performances > on a DB2 server... :-) After running for about 8 hours, the script runs into an error: [...] SCANNING actor: Ferguson, Duane (I) SCANNING actor: Fernández, Florentino (I) * FLUSHING SQLData... SCANNING actor

Re: [Imdbpy-devel] Bug: imdbpy2sql.py and DB2 9.5

2008-11-19 Thread Davide Alberani
On Nov 19, Joachim Selke <[EMAIL PROTECTED]> wrote: > I think this is neccessary. I get an error (latest CVS version): Fixed. Now it's all to see if IMDbPY has decent performances on a DB2 server... :-) Thank you again! -- Davide Alberani <[EMAIL PROTECTED]> [PGP KeyID: 0x465BFD47] http://erl

Re: [Imdbpy-devel] Bug: imdbpy2sql.py and DB2 9.5

2008-11-19 Thread Joachim Selke
Davide Alberani wrote: > Seen; I've removed the checkfirst parameter on the dropTable call, > if ibm_db is used. > It's just a horrible work-around and I hope it doesn't break > anything else. :-) > > By the way, is it safe to call dropTable() if the table doesn't > exist, with ibm_db? > If not, I

Re: [Imdbpy-devel] Bug: imdbpy2sql.py and DB2 9.5

2008-11-18 Thread Davide Alberani
On Nov 17, Joachim Selke <[EMAIL PROTECTED]> wrote: > I created a simple test case and it seems to be a bug in the ibm_db > module. I already sent a message to their mailing list asking about this > issue: (not listed yet) Seen; I've removed the checkfirst

Re: [Imdbpy-devel] Bug: imdbpy2sql.py and DB2 9.5

2008-11-17 Thread Joachim Selke
Davide Alberani wrote: > May it be the ibm_db that doesn't handle it correctly? I'm really not > familiar with db's schema, sorry. > Anyway, I've never taken 'schema' in consideration, writing IMDbPY, > so it's possible a bug on our side. I created a simple test case and it seems to be a bug in t

Re: [Imdbpy-devel] Bug: imdbpy2sql.py and DB2 9.5

2008-11-16 Thread Davide Alberani
On Nov 16, Joachim Selke <[EMAIL PROTECTED]> wrote: > > params = {'encoding': encoding, 'convert_unicode': True} > > It does, great! :-) Thanks! I've committed it to the CVS (and removed the connection.set_autocommit call - I assume it's no more needed). > I found another issue regarding the

Re: [Imdbpy-devel] Bug: imdbpy2sql.py and DB2 9.5

2008-11-16 Thread Joachim Selke
Davide Alberani wrote: > So... yes, it's probably a good idea to let the ibm_db developers know > of this behavior. I just send a message to their mailing list. > What if (just to do a fast test) you change this line of the > setConnection function: > params = {'encoding': encoding} > > to thi

Re: [Imdbpy-devel] Bug: imdbpy2sql.py and DB2 9.5

2008-11-16 Thread Davide Alberani
On Nov 16, Joachim Selke <[EMAIL PROTECTED]> wrote: > I guess I found the problem. Excellent! That's a serious step toward a solution (last famous words ;-) > And indeed, the call of "unicode" is the important difference > between your test case and what IMDbPY is doing Right - I was sure to h

Re: [Imdbpy-devel] Bug: imdbpy2sql.py and DB2 9.5

2008-11-16 Thread Joachim Selke
Davide Alberani wrote: > If you find a way to make it work, let me know, please. I guess I found the problem. Let's have a look at your test case sqla.py again. If I change the lines for value in 'movie', 'tv series', 'tv movie', 'video movie', 'tv mini series', 'video game', 'episode': kt_in

Re: [Imdbpy-devel] Bug: imdbpy2sql.py and DB2 9.5

2008-11-15 Thread Davide Alberani
On Nov 15, Joachim Selke <[EMAIL PROTECTED]> wrote: > Well, actually good news is bad news here: The example works as it > should [...] > When doing the last step of printing, the program seems to freeze. [...] > Then, I cannot even abort the program by Ctrl-c. This bug is way to erratic to b

Re: [Imdbpy-devel] Bug: imdbpy2sql.py and DB2 9.5

2008-11-15 Thread Joachim Selke
Davide Alberani wrote: > In the attachment there's a little example. > It doesn't use IMDbPY, but as far as I can tell the code is totally > equivalent. Thanks for the code. :-) Well, actually good news is bad news here: The example works as it should (up to the last step of printing the result;

Re: [Imdbpy-devel] Bug: imdbpy2sql.py and DB2 9.5

2008-11-15 Thread Davide Alberani
On Nov 15, Joachim Selke <[EMAIL PROTECTED]> wrote: > Maybe this problem is not related to the autocommit issue at all. What > makes you conjecture that it is the cause here? Initially the fact that in some of the first tests the table was not populated, and later one of your tests in which every

Re: [Imdbpy-devel] Bug: imdbpy2sql.py and DB2 9.5

2008-11-15 Thread Joachim Selke
Davide Alberani wrote: > Let me know if it works. Unfortunately, it doesn't. Same error as before: RUNNING imdbpy2sql.py SAVING imdbID values for movies... SKIPPING: no data. SAVING imdbID values for people... SKIPPING: no data. SAVING imdbID values for characters... SKIPPING: no data. SAVING imd

Re: [Imdbpy-devel] Bug: imdbpy2sql.py and DB2 9.5

2008-11-15 Thread Davide Alberani
On Nov 14, Joachim Selke <[EMAIL PROTECTED]> wrote: > Maybe you are suspecting the problem to be at the wrong place. I tried > to reconstruct what IMDbPY does when creating and using a cursor: [...] > This works like a charm Thank you very much for the time you spend on it! I've committed a new

Re: [Imdbpy-devel] Bug: imdbpy2sql.py and DB2 9.5

2008-11-14 Thread Joachim Selke
Joachim Selke wrote: > sqlalchemy.exceptions.DatabaseError: (DatabaseError) > ibm_db_dbi::DatabaseError: Binding Error: 'INSERT INTO kind_type (kind) > VALUES (?)' [u'movie'] > > > I also tried connection.set_autocommit(True) but it did not change > anything. I also do not get an error message,

Re: [Imdbpy-devel] Bug: imdbpy2sql.py and DB2 9.5

2008-11-14 Thread Joachim Selke
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Davide Alberani wrote: > My guess is that sqlalchemy's "connect" function isn't happy with > dictionaries as parameters. Anyway: here you're using SQLAlchemy 0.4, > right? Right. > But I have a Plan B: try, in alchemyadapter.setConnection, to > rep

Re: [Imdbpy-devel] Bug: imdbpy2sql.py and DB2 9.5

2008-11-14 Thread Davide Alberani
On Nov 14, Joachim Selke <[EMAIL PROTECTED]> wrote: > The above error can be fixed by changing conn_options to connect_args in > line 401 of alchemyadapter.py. Fine, but... I'm about to cry. ;-) > But then I get: [...] > sqlalchemy.exceptions.DBAPIError: (TypeError) connect() keywords must be

Re: [Imdbpy-devel] Bug: imdbpy2sql.py and DB2 9.5

2008-11-14 Thread Joachim Selke
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Davide Alberani wrote: >> Can I pass this option somehow to IMDbPY within the connection URI? > > I'm not sure it should not be considered an ibm_db_sa glitch, but anyway: > try the IMDbPY version in the cvs repository. I get this error: Traceback (

Re: [Imdbpy-devel] Bug: imdbpy2sql.py and DB2 9.5

2008-11-14 Thread Davide Alberani
On Nov 14, Joachim Selke <[EMAIL PROTECTED]> wrote: > > I would also try the second test with the > > ibm_db_dbi.SQL_AUTOCOMMIT_ON argument. > > You're right. Ok... time to buy a lottery ticket. ;-) > Can I pass this option somehow to IMDbPY within the connection URI? I'm not sure it should no

Re: [Imdbpy-devel] Bug: imdbpy2sql.py and DB2 9.5

2008-11-14 Thread Joachim Selke
Davide Alberani wrote: > I would also try the second test with the ibm_db_dbi.SQL_AUTOCOMMIT_ON > argument. You're right. This indeed works: import ibm_db_dbi connection = ibm_db_dbi.connect('DATABASE=mydb;HOSTNAME=myhost;PORT=myport; PROTOCOL=TCPIP;UID=myuser;PWD=mypass;', conn_options={ib

Re: [Imdbpy-devel] Bug: imdbpy2sql.py and DB2 9.5

2008-11-14 Thread Davide Alberani
On Nov 14, Joachim Selke <[EMAIL PROTECTED]> wrote: > I use a standard installation of DB2 9.5 (latest fixpack) on CentOS > 5, which is a binary-compatiable clone of the Red Hat Enterprise > Linux. The latter is supported by IBM. Therefore, this shouldn't > make any trouble, should it? Let's assu

Re: [Imdbpy-devel] Bug: imdbpy2sql.py and DB2 9.5

2008-11-14 Thread Joachim Selke
Davide Alberani wrote: > It can be a problem: > - in your database (some settings about unicode/collations?). I use a standard installation of DB2 9.5 (latest fixpack) on CentOS 5, which is a binary-compatiable clone of the Red Hat Enterprise Linux. The latter is supported by IBM. Therefore, this

Re: [Imdbpy-devel] Bug: imdbpy2sql.py and DB2 9.5

2008-11-13 Thread Davide Alberani
First of all: is anyone out there who has successfully used IMDbPY with DB2 or - at least - knows how to use the ibm_db module? On Nov 13, Joachim Selke <[EMAIL PROTECTED]> wrote: > Here are the results: [...] > > cursor.execute('INSERT INTO kind_type (kind) VALUES (?)', ['movie']) > No error,

Re: [Imdbpy-devel] Bug: imdbpy2sql.py and DB2 9.5

2008-11-13 Thread Joachim Selke
Hi, thanks for the quick response. :-) > Let me know if in the output there are warnings like > "Unable to import OperationalError" (or "IntegrityError"). Looks fine now. > Please try to run the following test and let me know which variations > of the cursor.execute call work (if any): Here ar

Re: [Imdbpy-devel] Bug: imdbpy2sql.py and DB2 9.5

2008-11-13 Thread Davide Alberani
On Nov 13, Joachim Selke <[EMAIL PROTECTED]> wrote: > I'm trying to import IMDB data into a DB2 database using the > imdbpy2sql.py script. Hi, and thank you for the bug report (I've added your name to the credits). > First, I get the following two errors, which can be fixed > individually by com

[Imdbpy-devel] Bug: imdbpy2sql.py and DB2 9.5

2008-11-13 Thread Joachim Selke
Hi, I'm trying to import IMDB data into a DB2 database using the imdbpy2sql.py script. I tried the lastest release of IMDbPY (3.8) as well as the CVS version. In both cases, I get some error messages when running the following command: imdbpy2sql.py -d DATADIR -u "ibm_db_sa://USER:[EMAIL PROTECTE