Skip to content

Conversation

@hazzik
Copy link
Member

@hazzik hazzik commented Nov 14, 2018

We have some compatibility issues with the newer driver, so need to upgrade

We have some compatibility issues with the newer driver, so need to upgrade
@hazzik
Copy link
Member Author

hazzik commented Nov 14, 2018

Most likely changes required are similar to nhibernate/nhibernate-envers#2

@hazzik hazzik changed the title WIP - Upgrade to Npgsql 4.0.3 WIP - Improve support of Npgsql 4 Nov 14, 2018
@hazzik hazzik changed the title WIP - Improve support of Npgsql 4 Improve support of Npgsql 4 Nov 15, 2018
@fredericDelaporte
Copy link
Member

fredericDelaporte commented Nov 15, 2018

So, Npgsql 4 still has issues with connections released from the second phase of a system transaction commit/rollback.
As explained here, the TeamCity build agent may require some manual actions for allowing PostgreSQL other builds to succeed.

The 3.2.5 failure may lead to pending prepared transaction on PostgreSQL db, causing it to prevent nhibernate database drop, wrecking all subsequent builds whatever the PR. It is then required to use the pgadmin tool on build agent for rollbacking pending prepared transactions (see here) and dropping the db.

As suggested here, this PR may have to introduce a new (TestDialect?) property for ignoring tests involving connections used in commit phases. Then something like the following could be added into SystemTransactionFixtureBase:

protected override bool AppliesTo(Dialect.Dialect dialect)
	=> (TestDialect.SupportsConnectionUseOnSystemTransactionPrepare ||
			!UseConnectionOnSystemTransactionPrepare) &&
		base.AppliesTo(dialect);

Copy link
Member

@fredericDelaporte fredericDelaporte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a bit mixed feelings about this change.

On the one hand, we already do this on Get, so doing this on Set is more consistent.

On the other hand, adding our own conversion here while all the other data providers do no require it and handles it themselves is likely to be an overhead for those other data-providers. They will still check the value type, and in some case even re-convert it. (That will be the case for Oracle with current NHibernate Double registration, which actually maps it to a numeric (or double precision which translates to numeric) instead of binary_double available since 10g.)

fredericDelaporte and others added 4 commits November 16, 2018 16:01
Since Npgsql 3.2.5, system transactions support has regressed. Those
tests were succeeding with Npgsql 3.2.4.1
Required TestDialect properties and ignore logic were already in
master.
@hazzik
Copy link
Member Author

hazzik commented Nov 26, 2018

I think for the most of the providers this will be no-op as types do typically match to the expected type. Also, most of the types already do some conversation on set, so it is not a big deal.

@fredericDelaporte fredericDelaporte added this to the 5.2 milestone Nov 26, 2018
@hazzik hazzik merged commit fa978cf into nhibernate:master Nov 26, 2018
@hazzik hazzik deleted the npgsql4 branch November 26, 2018 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants