summaryrefslogtreecommitdiff
path: root/test/engine/test_transaction.py
Commit message (Collapse)AuthorAgeFilesLines
* - Added basic isolation level support to the SQL Server dialectsMike Bayer2016-03-151-0/+4
| | | | | | via :paramref:`.create_engine.isolation_level` and :paramref:`.Connection.execution_options.isolation_level` parameters. fixes #3534
* - revert the change first made in a6fe4dc, as we are now generalizingMike Bayer2016-01-281-0/+21
| | | | | | | | | | | | | | | | | | | | | | | the warning here to all safe_reraise() cases in Python 2. - Revisiting :ticket:`2696`, first released in 1.0.10, which attempts to work around Python 2's lack of exception context reporting by emitting a warning for an exception that was interrupted by a second exception when attempting to roll back the already-failed transaction; this issue continues to occur for MySQL backends in conjunction with a savepoint that gets unexpectedly lost, which then causes a "no such savepoint" error when the rollback is attempted, obscuring what the original condition was. The approach has been generalized to the Core "safe reraise" function which takes place across the ORM and Core in any place that a transaction is being rolled back in response to an error which occurred trying to commit, including the context managers provided by :class:`.Session` and :class:`.Connection`, and taking place for operations such as a failure on "RELEASE SAVEPOINT". Previously, the fix was only in place for a specific path within the ORM flush/commit process; it now takes place for all transational context managers as well. fixes #2696
* PEP8 cleanup in /test/enginepr/163Eric Streeper2015-03-201-2/+6
|
* - Fixed bug in :class:`.Connection` and pool where theMike Bayer2015-02-041-0/+12
| | | | | | | | | :meth:`.Connection.invalidate` method, or an invalidation due to a database disconnect, would fail if the ``isolation_level`` parameter had been used with :meth:`.Connection.execution_options`; the "finalizer" that resets the isolation level would be called on the no longer opened connection. fixes #3302
* - A warning is emitted if the ``isolation_level`` parameter is usedMike Bayer2015-02-041-3/+25
| | | | | | | | | | | | | | | | with :meth:`.Connection.execution_options` when a :class:`.Transaction` is in play; DBAPIs and/or SQLAlchemy dialects such as psycopg2, MySQLdb may implicitly rollback or commit the transaction, or not change the setting til next transaction, so this is never safe. - Added new parameter :paramref:`.Session.connection.execution_options` which may be used to set up execution options on a :class:`.Connection` when it is first checked out, before the transaction has begun. This is used to set up options such as isolation level on the connection before the transaction starts. - added new documentation section detailing best practices for setting transaction isolation with sessions. fixes #3296
* - Added new user-space accessors for viewing transaction isolationMike Bayer2015-01-201-0/+22
| | | | | | | | | levels; :meth:`.Connection.get_isolation_level`, :attr:`.Connection.default_isolation_level`. - enhance documentation inter-linkage between new accessors, existing isolation_level parameters, as well as in the dialect-level methods which should be fully covered by Engine/Connection level APIs now.
* formattingMike Bayer2015-01-201-27/+30
|
* - repair autorollback for branchesMike Bayer2014-09-261-0/+12
|
* - Fixed bug where a "branched" connection, that is the kind you getMike Bayer2014-09-261-0/+73
| | | | | | | | when you call :meth:`.Connection.connect`, would not share transaction status with the parent. The architecture of branching has been tweaked a bit so that the branched connection defers to the parent for all transactional status and operations. fixes #3190
* - these tests don't test anything in SQLAlchemy - from our perpsective,Mike Bayer2014-09-191-133/+0
| | | | | | | we need to be in transactions (tested elsewhere) and we need to emit the correct FOR UPDATE strings (tested elsewhere). There's nothing in SQLA to be tested as far as validating that for update causes exceptions or not, and these tests frequently fail as they are timing sensitive.
* two_phase_recover, COMMIT PREPARED in transactionTony Locke2014-08-021-3/+4
| | | | | | | | | | | | | | In test/engine/test_transaction/test_two_phase_recover(), a COMMIT PREPARED is issued while in a transaction. This causes an error, and a prepared transaction is left hanging around which causes the subsequent test to hang. I've altered the test to execute the offending query with autocommit=true, then when it gets to the COMMIT PRPARED it can go ahead. There's another complication for pg8000 because its tpc_recover() method started a transaction if one wasn't already in progress. I've decided that this is incorrect behaviour and so from pg8000-1.9.13 this method never starts or stops a transaction.
* typo: s/thbe/thepr/100Priit Laes2014-06-281-1/+1
|
* typo: s/tranasction/transactionPriit Laes2014-06-281-2/+2
|
* - rename __multiple__ to __backend__, and apply __backend__ to a large ↵Mike Bayer2014-03-241-0/+8
| | | | | | number of tests. - move out logging tests from test_execute to test_logging
* - continue with [ticket:2907] and further clean up how we set upMike Bayer2014-01-131-1/+2
| | | | | | | | | | | | | | _reset_agent, so that it's local to the various begin_impl(), rollback_impl(), etc. this allows setting/resetting of the flag to be symmetric. - don't set _reset_agent if it's not None, don't unset it if it isn't our own transaction. - make sure we clean it out in close(). - basically, we're dealing here with pools using "threadlocal" that have a counter, other various mismatches that the tests bring up - test for recover() now has to invalidate() the previous connection, because closing it actually rolls it back (e.g. this test was relying on the broken behavior).
* - :class:`.Connection` now associates a newMike Bayer2014-01-121-0/+133
| | | | | | | | | | | | | | | | | | | | | | :class:`.RootTransaction` or :class:`.TwoPhaseTransaction` with its immediate :class:`._ConnectionFairy` as a "reset handler" for the span of that transaction, which takes over the task of calling commit() or rollback() for the "reset on return" behavior of :class:`.Pool` if the transaction was not otherwise completed. This resolves the issue that a picky transaction like that of MySQL two-phase will be properly closed out when the connection is closed without an explicit rollback or commit (e.g. no longer raises "XAER_RMFAIL" in this case - note this only shows up in logging as the exception is not propagated within pool reset). This issue would arise e.g. when using an orm :class:`.Session` with ``twophase`` set, and then :meth:`.Session.close` is called without an explicit rollback or commit. The change also has the effect that you will now see an explicit "ROLLBACK" in the logs when using a :class:`.Session` object in non-autocommit mode regardless of how that session was discarded. Thanks to Jeff Dairiki and Laurence Rowe for isolating the issue here. [ticket:2907]
* something changed the name here, probably one of those doc pullreqsMike Bayer2013-11-211-1/+1
|
* - remove informix dialect, moved out to ↵Mike Bayer2013-11-171-3/+0
| | | | | | https://bitbucket.org/zzzeek/sqlalchemy_informixdb - remove informix, maxdb, access symbols from tests etc.
* Improved support for the cymysql driver, supporting version 0.6.5,Mike Bayer2013-08-171-1/+0
| | | | courtesy Hajime Nakagami.
* - refactor pool a bit so that intent between ↵Mike Bayer2013-07-021-11/+11
| | | | | | | | | | | | | | ConnectionRecord/ConnectionFairy is clear; make sure that the DBAPI connection passed to the reset-on-return events/dialect hooks is also a "fairy", so that dictionaries like "info" are available. [ticket:2770] - rework the execution_options system so that the dialect is given the job of making any immediate adjustments based on a set event. move the "isolation level" logic to use this new system. Also work things out so that even engine-level execution options can be used for things like isolation level; the dialect attaches a connect-event handler in this case to handle the task. - to support this new system as well as further extensibiltiy of execution options add events engine_connect(), set_connection_execution_options(), set_engine_execution_options()
* tweak the timings here to maximize chance of test successMike Bayer2013-06-291-31/+12
|
* - the raw 2to3 runMike Bayer2013-04-271-10/+10
| | | | - went through examples/ and cleaned out excess list() calls
* fix decorator positionHajime Nakagami2013-03-021-1/+1
|
* avoid drop table in mysql+cymysql test because of deadlockHajime Nakagami2013-02-221-0/+1
|
* trying different approaches to test layout. in this one, the testing modulesMike Bayer2012-09-271-6/+6
| | | | | | | become an externally usable package but still remains within the main sqlalchemy parent package. in this system, we use kind of an ugly hack to get the noseplugin imported outside of the "sqlalchemy" package, while still making it available within sqlalchemy for usage by third party libraries.
* -whitespace bonanza, contdMike Bayer2012-07-281-9/+9
|
* - [feature] Added support for the "isolation_level"Mike Bayer2012-02-121-27/+65
| | | | | | | parameter to all MySQL dialects. Thanks to mu_mind for the patch here. [ticket:2394] - add documentation examples for mysql, postgresql - pep8ing
* - adjust some tests and such to work better with a mysql 5.5 installMike Bayer2011-10-111-0/+1
| | | | | - Added mysql_length parameter to Index construct, specifies "length" for indexes. [ticket:2293]
* - Context manager provided by Connection.begin()Mike Bayer2011-07-121-0/+22
| | | | | will issue rollback() if the commit() fails, not just if an exception occurs.
* - Unit tests pass 100% on MySQL installedMike Bayer2011-06-021-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | on windows, after aggressive exclusion of a wide variety of tests. Not clear to what degree the failures are related to version 5.5 vs. the usage of windows, in particular the ON UPDATE CASCADE immediately crashes the server. The features being tested here are all edge cases not likely to be used in typical MySQL environments. - Removed the "adjust casing" step that would fail when reflecting a table on MySQL on windows with a mixed case name. After some experimenting with a windows MySQL server, it's been determined that this step wasn't really helping the situation much; MySQL does not return FK names with proper casing on non-windows platforms either, and removing the step at least allows the reflection to act more like it does on other OSes. A warning here has been considered but its difficult to determine under what conditions such a warning can be raised, so punted on that for now - added some docs instead. [ticket:2181] - supports_sane_rowcount will be set to False if using MySQLdb and the DBAPI doesn't provide the constants.CLIENT module.
* - query.count() emits "count(*)" instead ofMike Bayer2011-05-101-0/+1
| | | | | "count(1)". [ticket:2162] - another test that should be excluded from "low-connections"
* - given that Oracle's issue is not just open connections, but *closed* ones ↵Mike Bayer2011-05-091-1/+2
| | | | | | | | too, go really heavy handed and start marking tests as "requires.ad_hoc_engines", add a flag --low-connections that will switch the engine reaper mechanism to use as *few* distinct engines and connections as possible, many engine tests that really need their own engines are just skipped.
* - hardcore force every connection into a strong-referenced set, rollback on ↵Mike Bayer2011-04-251-13/+14
| | | | | | | | | every test, close on every context. this uses pool events but bypasses the pool's fairy/record/dispose services. pypy still seems to expose some holes in that at least as far as what some (or maybe just one, cant find it yet) of the tests does. haven't tested this too deeply, just on sqlite + postgres, cypthon 2.7 + pypy. will see what the buildbot says
* - move all the comments that got shoved below the fixture grabs back upMike Bayer2011-03-271-0/+1
|
* - remove test.sql._base, test.engine._base, test.orm._base, move those ↵Mike Bayer2011-03-271-7/+8
| | | | | | | classes to a new test.lib.fixtures module - move testing.TestBase to test.lib.fixtures - massive search and replace
* corrected a bunch of spelling typosDiana Clarke2011-02-281-1/+1
|
* - py3k fix regarding new exception systemMike Bayer2011-02-091-0/+1
| | | | | - this test keeps throwing a TNS error on Oracle on the buildbot only, runs locally, seems to be related to some scaling/memory type of issue on the bot
* - execution_options() on Connection acceptsMike Bayer2011-01-161-7/+47
| | | | | | | | | | "isolation_level" argument, sets transaction isolation level for that connection only until returned to the connection pool, for thsoe backends which support it (SQLite, Postgresql) [ticket:2001] - disallow the option on Engine (use isolation_level to create_engine()), Executable (we don't want to check/set per statement) - docs
* - add dialect.reset_isolation_level(), revertsMike Bayer2011-01-161-0/+29
| | | | - base not implemented methods on Dialect
* - factor consistent set_isolation_level(), get_isolation_level()Mike Bayer2011-01-161-1/+64
| | | | | | per-connection methods for sqlite, postgresql, psycopg2 dialects - move isolation test suite to test engines/test_transaction - preparing for [ticket:2001]
* - merge r43460573c27a:4993c7eae8e5d117ff342bdc59f3b0635b898e2c of 0.6 branchMike Bayer2011-01-081-0/+21
|
* - whitespace removal bonanzaMike Bayer2011-01-021-11/+11
|
* - further fixes to no trans in progress, no trans ever for TLEngine, ↵Mike Bayer2010-12-091-0/+24
| | | | [ticket:1998]
* - Threadlocal engine methods rollback(), commit(),Mike Bayer2010-12-081-0/+12
| | | | | prepare() won't raise if no transaction is in progress; this was a regression introduced in 0.6. [ticket:1998]
* - sqlalchemy.test and nose plugin moves back to being entirelyMike Bayer2010-11-281-4/+4
|\ | | | | | | | | | | | | | | | | | | | | | | outside of "sqlalchemy" and under "test/". Rationale: - coverage plugin works without issue, without need for an awkward additional package install - command line for "nosetests" isn't polluted with SQLAlchemy options [ticket:1949]
| * - move sqlalchemy.test to test.libMike Bayer2010-11-151-4/+4
| |
* | - fixes for PG, mysql, twophaseMike Bayer2010-11-201-2/+5
|/ | | | | - added "pool_events" arg to create_engine(), "events" to pool, allowing establishment of listeners which fire before those of the dialect
* - *Major* cleanup / modernization of the InformixMike Bayer2010-10-011-9/+9
| | | | | dialect for 0.6, courtesy Florian Apolloner. [ticket:1906]
* mark this as intermittent crashes on the buildbot - reason for failures not ↵Mike Bayer2010-08-081-0/+1
| | | | clear
* Python-tidy test/engine and test/aaa_profiling, 80% auto + 20% manual ↵Mike Bayer2010-07-111-298/+287
| | | | intervention