相关疑难解决方法(0)

DatabaseError:当前事务被中止,命令被忽略直到事务块结束

我收到的消息有很多错误:

"DatabaseError: current transaction is aborted, commands ignored until end of transaction block"
Run Code Online (Sandbox Code Playgroud)

之后从python-psycopg更改为python-psycopg2作为Django项目的数据库引擎.

代码保持不变,只是不知道这些错误来自哪里.

python django postgresql psycopg2

238
推荐指数
13
解决办法
18万
查看次数

陷入django南迁移 - TransactionManagement错误

我在申请django南迁时遇到了麻烦:

与往常一样,我在成功进行模式迁移后执行了migrate命令

python manage.py migrate webapp
Run Code Online (Sandbox Code Playgroud)

日志控制台:

Running migrations for webapp:
 - Migrating forwards to 0020_auto__add_example.
 > webapp:0020_auto__add_example
TransactionManagementError: Transaction managed block ended with pending COMMIT/ROLLBACK
Run Code Online (Sandbox Code Playgroud)

该错误与特定迁移无关,就好像我向后移动并尝试另一个它显示相同的消息.

编辑.这是查询的日志:

(0.005) SELECT `south_migrationhistory`.`id`, `south_migrationhistory`.`app_name`, `south_migrationhistory`.`migration`, `south_migrationhistory`.`applied` FROM `south_migrationhistory` WHERE `south_migrationhistory`.`applied` IS NOT NULL ORDER BY `south_migrationhistory`.`applied` ASC; args=()
Running migrations for webapp:
 - Migrating forwards to 0020_auto__add_example.
 > webapp:0020_auto__add_example
(0.002) CREATE TABLE ROLLBACK_TEST (X INT); args=()
TransactionManagementError: Transaction managed block ended with pending COMMIT/ROLLBACK
Run Code Online (Sandbox Code Playgroud)

python django transactions django-south

6
推荐指数
2
解决办法
2644
查看次数

InternalError:当前事务被中止,命令被忽略直到事务块结束

我在使用多处理库的子进程中进行数据库调用时遇到此错误.

访问:Pastie

InternalError:当前事务被中止,命令被忽略直到事务块结束

这是一个Postgre数据库,使用psycopg2驱动程序web.py.

但是,如果我使用threading.Thread而不是multiprocessing.Process我没有得到这个错误.
知道如何解决这个问题吗?

python postgresql psycopg2 multiprocessing web.py

3
推荐指数
1
解决办法
9611
查看次数