Skip to content

Throw for Criteria over not mapped entity #2487

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Sep 7, 2020

Conversation

bahusoid
Copy link
Member

@bahusoid bahusoid commented Aug 14, 2020

Fixes #1095

@bahusoid bahusoid changed the title Throw for Criteria over not mapped entity WIP Throw for Criteria over not mapped entity Aug 14, 2020
@bahusoid bahusoid changed the title WIP Throw for Criteria over not mapped entity Throw for Criteria over not mapped entity Aug 31, 2020

private void IgnoreIfTransactionScopeInsideSessionIsNotSupported()
{
if (!Sfi.ConnectionProvider.Driver.SupportsSystemTransactions || !TestDialect.SupportsDependentTransaction)
Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not actually sure that failed tests are related to TestDialect.SupportsDependentTransaction but Postgres gives for affected tests the following exception:

Error : NHibernate.Test.SystemTransactions.TransactionWithoutConnectionFromPrepareNotificationFixture.TwoTransactionScopesInsideOneSession
System.Transactions.TransactionAbortedException : The transaction has aborted.
  ----> System.AggregateException : One or more errors occurred. (55000: prepared transactions are disabled)
  ----> Npgsql.PostgresException : 55000: prepared transactions are disabled
Data:
  Severity: ERROR
  SqlState: 55000
  Code: 55000
  MessageText: prepared transactions are disabled
  Hint: Set max_prepared_transactions to a nonzero value.
  File: twophase.c
  Line: 336
  Routine: MarkAsPreparing
   at System.Transactions.TransactionStateAborted.EndCommit(InternalTransaction tx)
   at System.Transactions.CommittableTransaction.Commit()
   at System.Transactions.TransactionScope.InternalDispose()
   at System.Transactions.TransactionScope.Dispose()
   at NHibernate.Test.SystemTransactions.TransactionNotificationFixture.TwoTransactionScopesInsideOneSession() in /home/travis/build/nhibernate/nhibernate-core/src/NHibernate.Test/SystemTransactions/TransactionNotificationFixture.cs:line 119
--AggregateException
   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at Npgsql.NpgsqlConnector.ExecuteInternalCommand(String query) in C:\projects\npgsql\src\Npgsql\NpgsqlConnector.cs:line 1977
   at Npgsql.VolatileResourceManager.Prepare(PreparingEnlistment preparingEnlistment) in C:\projects\npgsql\src\Npgsql\VolatileResourceManager.cs:line 108
--PostgresException
   at Npgsql.NpgsqlConnector.<>c__DisplayClass161_0.<<ReadMessage>g__ReadMessageLong|0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at Npgsql.NpgsqlConnector.<>c__DisplayClass161_0.<<ReadMessage>g__ReadMessageLong|0>d.MoveNext() in C:\projects\npgsql\src\Npgsql\NpgsqlConnector.cs:line 1032
--- End of stack trace from previous location where exception was thrown ---
   at Npgsql.NpgsqlConnector.ExecuteInternalCommand(FrontendMessage message, Boolean async) in C:\projects\npgsql\src\Npgsql\NpgsqlConnector.cs:line 1988

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.

NH-2829 - QueryOver/Criteria should throw exception when querying against unmapped class
2 participants