On Mon, Aug 27, 2007 at 09:04:06PM -0500, Kevin J. Rice wrote: > the moment I hit the first > error, the dbconnection says 'current transaction is aborted, commands > ignored until end of transaction block'.
The message comes from PostgreSQL, not from SQLObject. After you have hit an error Postgres aborts the transaction and waits until the client closes the connection. > > ... to speed up joins try SQL*Joins classes ... > Yes. Hmmm. We've tried this. Consider: > > ...Presume standard sql*join setup... > for recA in tableA.select(): > .. Do stuff with recA > for brec in recA.btablerecs: > .. do stuff with brec.field1 > .. Do other stuff with recA > > This generates something like 12 bazillion selects: > Select record_id_list from tableA > Select * from tableA where record id = 1 > Select record_id_list from tableB where tableb.tableaid = 1 > Select * from tableB where record id = 1 > Select * from tableB where record id = 2 > ... (until done) > Select * from tableA where record id = 2 > ... (until done) > Select * from tableA where record id = 3 Seems you have tried something different. The following program class TableA(SQLObject): table_b = SQLRelatedJoin('TableB', addRemoveName='B') class TableB(SQLObject): table_a = SQLRelatedJoin('TableA', addRemoveName='A') TableB.createTable() TableA.createTable() b1 = TableB() b2 = TableB() a1 = TableA() a1.addB(b1) a1.addB(b2) for b in a1.table_b: print b produces the following output: 1/Query : CREATE TABLE table_b ( id INTEGER PRIMARY KEY ) 1/QueryR : CREATE TABLE table_b ( id INTEGER PRIMARY KEY ) 2/Query : CREATE TABLE table_a ( id INTEGER PRIMARY KEY ) 2/QueryR : CREATE TABLE table_a ( id INTEGER PRIMARY KEY ) 3/Query : CREATE TABLE table_a_table_b ( table_a_id INT NOT NULL, table_b_id INT NOT NULL ) 3/QueryR : CREATE TABLE table_a_table_b ( table_a_id INT NOT NULL, table_b_id INT NOT NULL ) 4/QueryIns: INSERT INTO table_b VALUES (NULL) 4/QueryR : INSERT INTO table_b VALUES (NULL) 5/QueryOne: SELECT NULL FROM table_b WHERE id = (1) 5/QueryR : SELECT NULL FROM table_b WHERE id = (1) 6/QueryIns: INSERT INTO table_b VALUES (NULL) 6/QueryR : INSERT INTO table_b VALUES (NULL) 7/QueryOne: SELECT NULL FROM table_b WHERE id = (2) 7/QueryR : SELECT NULL FROM table_b WHERE id = (2) 8/QueryIns: INSERT INTO table_a VALUES (NULL) 8/QueryR : INSERT INTO table_a VALUES (NULL) 9/QueryOne: SELECT NULL FROM table_a WHERE id = (1) 9/QueryR : SELECT NULL FROM table_a WHERE id = (1) 10/Query : INSERT INTO table_a_table_b (table_a_id, table_b_id) VALUES (1, 1) 10/QueryR : INSERT INTO table_a_table_b (table_a_id, table_b_id) VALUES (1, 1) 11/Query : INSERT INTO table_a_table_b (table_a_id, table_b_id) VALUES (1, 2) 11/QueryR : INSERT INTO table_a_table_b (table_a_id, table_b_id) VALUES (1, 2) 12/Select : SELECT table_b.id FROM table_b, table_a_table_b, table_a WHERE ((table_b.id = table_a_table_b.table_b_id) AND ((table_a_table_b.table_a_id = table_a.id) AND (table_a.id = 1))) 12/QueryR : SELECT table_b.id FROM table_b, table_a_table_b, table_a WHERE ((table_b.id = table_a_table_b.table_b_id) AND ((table_a_table_b.table_a_id = table_a.id) AND (table_a.id = 1))) <TableB 1 > <TableB 2 > Look at the last SELECT - there is one select to draw all objects for .table_b. Oleg. -- Oleg Broytmann http://phd.pp.ru/ [EMAIL PROTECTED] Programmers don't die, they just GOSUB without RETURN. ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ sqlobject-discuss mailing list sqlobject-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss