Re: [sqlalchemy] SQLAlchemy transaction ID

2021-01-29 Thread Thierry Florac
t; > > On Wed, Jan 27, 2021, at 2:23 PM, Thierry Florac wrote: > > Hi, > I'm actually using two databases connections: one is my "main" connection, > opened on a ZODB (with RelStorage), and **sometimes** I have to open > another connection on another database (and event

Re: [sqlalchemy] SQLAlchemy transaction ID

2021-01-27 Thread Thierry Florac
docs.io Le mer. 27 janv. 2021 à 19:19, Mike Bayer a écrit : > > > On Wed, Jan 27, 2021, at 8:32 AM, Thierry Florac wrote: > > > Hi, > I'm actually using SQLAlchemy with Pyramid and zope.sqlalchemy packages. > My main database connection is a ZODB connection and, when requ

[sqlalchemy] SQLAlchemy transaction ID

2021-01-27 Thread Thierry Florac
Hi, I'm actually using SQLAlchemy with Pyramid and zope.sqlalchemy packages. My main database connection is a ZODB connection and, when required, I create an SQLAlchemy session which is joined to main transaction using this kind of code: from sqlalchemy.orm import scoped_session, sessionmaker

Re: [sqlalchemy] Handy package to debug flask+sqlalchemy+orm (flask_sqla_debug)

2016-10-31 Thread Thierry Florac
Hi, For Pyramid, another interesting package is SQLTap, which provides useful informations about execution of SQLAlchemy queries... Best regards, Thierry 2016-10-31 11:05 GMT+01:00 Simon King : > On Sun, Oct 30, 2016 at 9:36 PM, Alfred Perlstein >

Re: [sqlalchemy] Using literals in ORM update/delete query

2016-09-12 Thread Thierry Florac
...I > think this comes up a lot over there it's like an OCI thing. > > > > On 09/12/2016 03:20 PM, Thierry Florac wrote: > >> Hi Mike, >> >> I really agrea with you on all the points you mentionned. And I won't >> add anything about the cost of an

Re: [sqlalchemy] Using literals in ORM update/delete query

2016-09-12 Thread Thierry Florac
ike...@zzzcomputing.com>: > > > On 09/12/2016 09:11 AM, Thierry Florac wrote: > >> Hi, >> >> I'm working with an Oracle database which, for a reason I can't >> understand, doesn't want to use indexes when working on a given table >> (which is quite large) with

[sqlalchemy] Using literals in ORM update/delete query

2016-09-12 Thread Thierry Florac
Hi, I'm working with an Oracle database which, for a reason I can't understand, doesn't want to use indexes when working on a given table (which is quite large) with prepared statements! I know I can use literal columns when running "select" queries (using the "literal_column" function), so that

Re: [sqlalchemy] Relationship between two databases

2016-02-23 Thread Thierry Florac
Hi, I don't think that the solution can come from SQLAlchemy. You may have to create a database link between your two databases to be able to query both of them with a single instruction... Best regards, Thierry 2016-02-23 11:43 GMT+01:00 Mehdi : > Hi > Is it possible two

Re: [sqlalchemy] Recommended way to delete record given instance?

2016-02-06 Thread Thierry Florac
Hi ! Did you try "session.delete(myrecord)" ? Best regards, Thierry 2016-02-06 5:16 GMT+01:00 Alex Hall : > Hello all, > Another basic question: given an instance of a record, can I somehow > delete the record from a table? The longer story is this. > > I have my app,

Re: [sqlalchemy] SQL join between two tables from two databases

2015-01-17 Thread Thierry Florac
What database server do you use? 2015-01-17 0:49 GMT+01:00 Brian Glogower bglogo...@ifwe.co: Hi all, I am trying to do a join between two tables, each residing on a separate databases. Here is the table info for both. I have removed extraneous columns from each table. Table A from DB 1:

[sqlalchemy] Closing pool connections

2014-09-25 Thread Thierry Florac
Hi, I have a multi-threaded web application using SQLAlchemy connections pool. As soon as a connection is opened, it's maintained opened in the pool even if it's not used anymore. On a long run, this can consume too much unnecessary connections and database server resources. So what I'm actually

Re: [sqlalchemy] Closing pool connections

2014-09-25 Thread Thierry Florac
connection. Do you think that using pool events to monitor a pool's connections could be a good starting point? Best regards, Thierry 2014-09-25 18:04 GMT+02:00 Michael Bayer mike...@zzzcomputing.com: On Sep 25, 2014, at 4:33 AM, Thierry Florac tflo...@gmail.com wrote: Hi, I have a multi

Re: [sqlalchemy] Oracle index not used on SQLAlchemy prepared statement

2014-05-13 Thread Thierry Florac
queries. Even if only a small set or arguments data types are supported, how could I use it? Best regards, Thierry 2014-05-13 0:37 GMT+02:00 Michael Bayer mike...@zzzcomputing.com: On May 12, 2014, at 6:12 PM, Thierry Florac tflo...@gmail.com wrote: Hi, I use Python and SQLAlchemy to access

Re: [sqlalchemy] Oracle index not used on SQLAlchemy prepared statement

2014-05-13 Thread Thierry Florac
2014-05-13 12:20 GMT+02:00 Michael Bayer mike...@zzzcomputing.com: On May 13, 2014, at 4:21 AM, Thierry Florac tflo...@gmail.com wrote: Hi Michael, We already tried to explain the Oracle query execution plan with our DBA. The result is that the Oracle server prefers to make a full table scan

[sqlalchemy] Oracle index not used on SQLAlchemy prepared statement

2014-05-12 Thread Thierry Florac
Hi, I use Python and SQLAlchemy to access an Oracle 11 database. As far as I think, SQLAlchemy always use prepared statements. On a huge table (4 millions records), correctly indexed, SQLAlchemy filters queries doesn't use the index, so doing a full table scan is very slow ; using the same SQL

Re: [sqlalchemy] [ANN] SQLTap - SQL profiling and introspection for SQLAlchemy applications

2014-03-10 Thread Thierry Florac
That sounds really great. Simple question : is there any way to use SQLTap in a multi-processes WSGI environment ?? Best regards, Thierry 2014-03-10 5:28 GMT+01:00 Michael Bayer mike...@zzzcomputing.com: hey that looks pretty nice, ill give it a shoutout. On Mar 9, 2014, at 9:21 PM, Alan

Re: [sqlalchemy] Anybody have twophase/zope.sqlalchemy/MySQL working?

2013-12-12 Thread Thierry Florac
Hi, I'm using two-phase transactions with ZODB, PostgreSQL and Oracle databases connected with SQLAlchemy without problem. I'm not using native zope.sqlalchemy package, but another package called ztfy.alchemy that I've built (based on zc.alchemy and zope.sqlalchemy), and I didn't tried with MySQL.

Re: [sqlalchemy] SQLAlchemy transaction problem

2012-11-21 Thread Thierry Florac
email to sqlalchemy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en. On Nov 20, 2012, at 6:33 PM, Thierry Florac wrote: Hi Michael, Following your guidelines, this is the first test I made against cx_Oracle : conn

Re: [sqlalchemy] SQLAlchemy transaction problem

2012-11-20 Thread Thierry Florac
On Nov 19, 2012, at 6:23 PM, Thierry Florac wrote: As far as I can understand it, I'm globally OK with you but... probably not completely :-\ I agree with the fact that SQLAlchemy is not the only package which takes part into the global transaction, as SA's session is handled by a Zope

Re: [sqlalchemy] SQLAlchemy transaction problem

2012-11-20 Thread Thierry Florac
to come up with workarounds for existing issues. On Nov 20, 2012, at 4:28 AM, Thierry Florac wrote: Hi Michael, This is a complete traceback produced by removing my checking code against attribute modification. Original code is then as simple as this: @ajax.handler def

Re: [sqlalchemy] SQLAlchemy transaction problem

2012-11-19 Thread Thierry Florac
Le Mon, 19 Nov 2012 10:23:14 -0500, Michael Bayer mike...@zzzcomputing.com a écrit: On Nov 19, 2012, at 8:10 AM, Thierry Florac wrote: Hi, I'm using SQLALchemy (currently 0.7.3 in this project, also tested with 0.7.9) with cx_Oracle-5.1.1 in a Zope3 project. SQLAlchemy

Re: [sqlalchemy] Foreign key between single field and remote composite key

2012-06-18 Thread Thierry Florac
Hi Michael, Le samedi 16 juin 2012 17:54:21 UTC+2, Michael Bayer a écrit : On Jun 16, 2012, at 11:41 AM, Michael Bayer wrote: It's not a basic question at all as this is a rare edge case, and it's not a foreign key by definition. You need to relate the two tables based on a SQL

Re: [sqlalchemy] Foreign key between single field and remote composite key

2012-06-18 Thread Thierry Florac
Hi, Le lundi 18 juin 2012 12:07:46 UTC+2, Thierry Florac a écrit : Hi Michael, Le samedi 16 juin 2012 17:54:21 UTC+2, Michael Bayer a écrit : On Jun 16, 2012, at 11:41 AM, Michael Bayer wrote: It's not a basic question at all as this is a rare edge case, and it's not a foreign key

[sqlalchemy] Foreign key between single field and remote composite key

2012-06-16 Thread Thierry Florac
Hi, I have a (probably) quite basic foreign key problem. My parent table has a composite primary key based on two (fixed width) string attributes; in my child tables, this key is stored in a single attribute which stores the concatenation of the two parent key attributes. So, is there any easy

Re: [sqlalchemy] Foreign key between single field and remote composite key

2012-06-16 Thread Thierry Florac
Hi Michael, Do you take a break sometimes during the week-end? ;-) Well, this seems quite fine, and a very quick answer as usual!!! I also agree that this is a bad model, but data is provided by an external partner and I can't update it :-( I was just sure that SA was able to handle it anyway

[sqlalchemy] Problem with declarative polymorphic inheritance

2012-06-15 Thread Thierry Florac
Hi, I'm using SQLAlchemy (0.7.4) with GeoAlchemy to map tables containing geographic entities from a PostgreSQL/PostGIS database. As I have to handle data from several parts of the world, each part using it's own geographic projection, my testing model which I'll try to describe is based on:

[sqlalchemy] Re: Problem with declarative polymorphic inheritance

2012-06-15 Thread Thierry Florac
Le vendredi 15 juin 2012 12:00:28 UTC+2, Thierry Florac a écrit : Hi, I'm using SQLAlchemy (0.7.4) with GeoAlchemy to map tables containing geographic entities from a PostgreSQL/PostGIS database. As I have to handle data from several parts of the world, each part using it's own

Re: [sqlalchemy] Strange update problem...

2011-12-02 Thread Thierry Florac
2011/12/2 Michael Bayer mike...@zzzcomputing.com: On Dec 1, 2011, at 7:09 PM, Thierry Florac wrote: 2011/12/2 Michael Bayer mike...@zzzcomputing.com: On Dec 1, 2011, at 5:38 PM, Thierry Florac wrote: Hi, So it seems that when resources are in the form and NOT modified, the matching task

[sqlalchemy] Outer join question

2011-12-01 Thread Thierry Florac
Hi, I have a little problem with outer joins (I use QSLAlchemy 0.5.6). I have two tables, managing tasks and activities : class Task(Base): __tablename__ = 'tache' id = Column(Integer, Sequence('seq_tache_id'), primary_key=True) libelle = Column(Unicode(50)) description =

[sqlalchemy] Re: Outer join question

2011-12-01 Thread Thierry Florac
) \ .outerjoin(TaskPM, Activity.task_pm) \ .filter(...) Best regards, Thierry 2011/12/1 Thierry Florac tflo...@gmail.com: Hi, I have a little problem with outer joins (I use QSLAlchemy 0.5.6). I have two tables, managing tasks and activities : class Task(Base

[sqlalchemy] Strange update problem...

2011-12-01 Thread Thierry Florac
Hi, Another quite strange problem using SQLAlchemy... I've created two classes, with matching interfaces build with zope.interface and zope.schema packages ; a web form is build with z3c.form package ; everything is fine ! My problem is quite simple to describe : I have a main class which is a

Re: [sqlalchemy] Strange update problem...

2011-12-01 Thread Thierry Florac
2011/12/2 Michael Bayer mike...@zzzcomputing.com: On Dec 1, 2011, at 5:38 PM, Thierry Florac wrote: Hi, So it seems that when resources are in the form and NOT modified, the matching task is not flagged dirty and is not saved in database. I just don't understand why !!! Only a full usage

Re: [sqlalchemy] SQLAlchemy opened connection on shutdown Oracle server

2010-12-20 Thread Thierry Florac
Yes, that's what I thought... I actually use a pool_recycle parameter of 3600 to recycle active connections every hour, but the problem remains the same as before (with default value of -1). So I'm a bit stuck :-( Regards, Thierry 2010/12/20 Michael Bayer mike...@zzzcomputing.com: This is a