Closed fishcakez closed 8 years ago
I agree with all fixes.
Pushed fixes for the last two to Ecto.
Solution:
{:error, :rollback}
[1][1] Why is it :rollback
and not the reason for the rollback?
We return :rollback
only in the case we rollback without an explicit Repo.rollback
call. However, we can change it to anything you want as this is meant for Ecto 2.0.
I don't mind either way so lets keep the same behaviour. I just wanted to know why :P.
pool_name
and DBConnection uses name
to name the pool process on start. Solution: Leave as is and rewrite in Ecto.:shutdown
to set the shutdown strategy of connection processes and DBConnection does not. Solution: Add :shutdown
to Sojourn pool as Poolboy does not allow setting this.terminate/2
proxy callback with reason :normal
, {:disconnect, err}
or {:stop, reason}
depending on check in method.I don't mind either way so lets keep the same behaviour. I just wanted to know why :P.
We could include a stacktrace but because we are rolling back only because someone internally called Repo.rollback inside an inner transaction, I am not sure that stacktrace makes sense. :)
I've done the DBConnection changes except the transaction rollback change. Down to 7 failing tests in Ecto, 2 of which are due to incorrect rollback behaviour.
Transaction rollback behaviour now matches Ecto.
The Ecto branch needs a bit more work but is down to 1 failing test: https://github.com/fishcakez/ecto/tree/db_connection
This issue is to record changes required for Ecto integration.
pool
is calledpool_mod
in Ecto. Solution: rename in DBConnection topool
andproxy_mod
toproxy
.pool_timeout
is calledqueue_timeout
. Solution: rename in DBConnection as is more consistent and should be used in poolboy pool for sync stoppingmax_overflow
is calledpool_overflow
. Consider (soft?) deprecate in Ecto as the naming is inconsistent with other options.