擅长:python、mysql、java
<p>我在Heroku的PostgreSQL上和ponyORM有同样的错误。
我通过锁定线程直到它执行DB操作来解决这个问题。就我而言:</p>
<pre><code>lock = threading.Lock()
with lock:
PonyOrmEntity(name='my_name', description='description')
PonyOrmEntity.get(lambda u: u.name == 'another_name')
</code></pre>