Uni.ORM with PostgreSQL and .Net
In this example I used:
Npgsql -Version 3.1.10
CsvHelper -Version 2.16.3
log4net -Version 2.0.7
Uni.Extensions -Version 1.1.8 ( if you use Uni.Extensions 1.1.9, along with Uni.ORM 1.4.4, it will give error Field not found: 'Uni.Extensions.UniExtensions.stringType'.)
Uni.ORM -Version 1.4.4
Working sample code is available at
bitbucket.org/hemantup/orm/src/HEAD/UniORM144/
bitbucket.org/hemantup/orm/src/HEAD/Scripts/apps/10/
Probably you need to be careful about the active sessions with this ORM:
I got below mentioned error, if used more than 20 execution cycles with above said custom utility
Npgsql.NpgsqlException was unhandled
HResult=-2147467259
Message=The connection pool has been exhausted, either raise MaxPoolSize (currently 100) or Timeout (currently 15 seconds)
Source=Npgsql
ErrorCode=-2147467259
StackTrace:
at Npgsql.ConnectorPool.WaitForTask(Task task, NpgsqlTimeout timeout)
at Npgsql.ConnectorPool.Allocate(NpgsqlConnection conn, NpgsqlTimeout timeout)
at Npgsql.NpgsqlConnection.OpenInternal()
at Npgsql.NpgsqlConnection.Open()
at Uni.Orm.UniOrm.NewConnection()
at Uni.Orm.UniOrm.ExecuteScalar(CommandType commandType, String schema, String package, String commandText, Options options, Object[] args)
at Uni.Orm.UniOrm.ExecuteScalar[T](CommandType commandType, String schema, String package, String commandText, Options options, Object[] args)
at Uni.Orm.UniOrm.TryInvokeMember(InvokeMemberBinder binder, Object[] args, Object& result)
at CallSite.Target(Closure , CallSite , Object , String , String , String , Options , Object[] )
at Uni.Orm.UniOrm.Count(String schema, String table, String where, Options options, Object[] args)
at UniORM144.UniORM144Test.Main(String[] args) in c:\891\orm\orm\UniORM144\Program.cs:line 114
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:
This post is related to https://hemantrohtak.blogspot.com/2016/03/is-entity-framework-best-performing.html
In this example I used:
Npgsql -Version 3.1.10
CsvHelper -Version 2.16.3
log4net -Version 2.0.7
Uni.Extensions -Version 1.1.8 ( if you use Uni.Extensions 1.1.9, along with Uni.ORM 1.4.4, it will give error Field not found: 'Uni.Extensions.UniExtensions.stringType'.)
Uni.ORM -Version 1.4.4
Working sample code is available at
bitbucket.org/hemantup/orm/src/HEAD/UniORM144/
bitbucket.org/hemantup/orm/src/HEAD/Scripts/apps/10/
Probably you need to be careful about the active sessions with this ORM:
I got below mentioned error, if used more than 20 execution cycles with above said custom utility
Npgsql.NpgsqlException was unhandled
HResult=-2147467259
Message=The connection pool has been exhausted, either raise MaxPoolSize (currently 100) or Timeout (currently 15 seconds)
Source=Npgsql
ErrorCode=-2147467259
StackTrace:
at Npgsql.ConnectorPool.WaitForTask(Task task, NpgsqlTimeout timeout)
at Npgsql.ConnectorPool.Allocate(NpgsqlConnection conn, NpgsqlTimeout timeout)
at Npgsql.NpgsqlConnection.OpenInternal()
at Npgsql.NpgsqlConnection.Open()
at Uni.Orm.UniOrm.NewConnection()
at Uni.Orm.UniOrm.ExecuteScalar(CommandType commandType, String schema, String package, String commandText, Options options, Object[] args)
at Uni.Orm.UniOrm.ExecuteScalar[T](CommandType commandType, String schema, String package, String commandText, Options options, Object[] args)
at Uni.Orm.UniOrm.TryInvokeMember(InvokeMemberBinder binder, Object[] args, Object& result)
at CallSite.Target(Closure , CallSite , Object , String , String , String , Options , Object[] )
at Uni.Orm.UniOrm.Count(String schema, String table, String where, Options options, Object[] args)
at UniORM144.UniORM144Test.Main(String[] args) in c:\891\orm\orm\UniORM144\Program.cs:line 114
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:
This post is related to https://hemantrohtak.blogspot.com/2016/03/is-entity-framework-best-performing.html
No comments:
Post a Comment