小编Ana*_*nth的帖子

WCF服务中的SQLite AccessViolationException

我们有一个.NET Windows服务,它将WCF服务暴露给用户界面和系统的其他部分.它以.NET Framework 4.5为目标,并使用SQLite 1.0.92二进制文件与底层SQLite数据库进行通信.但是,在SQLite.Interop.dll中使用AccessViolationException(通过Windows事件查看器找到)运行一段时间后,Windows服务崩溃(自动停止).我在Connection close中遇到过关于此异常的文章,但在我们所有情况下,我们在使用WCF服务公开的方法查询或写入数据库时​​遇到此异常.堆栈跟踪如下:

Application: OurServer.exe
Framework Version: **v4.0.30319**
Description: The process was terminated due to an unhandled exception.
Exception Info: System.AccessViolationException
Stack:
   at System.Data.SQLite.UnsafeNativeMethods.sqlite3_bind_int(IntPtr, Int32, Int32)
   at System.Data.SQLite.UnsafeNativeMethods.sqlite3_bind_int(IntPtr, Int32, Int32)
   at System.Data.SQLite.SQLite3.Bind_Int32(System.Data.SQLite.SQLiteStatement, System.Data.SQLite.SQLiteConnectionFlags, Int32, Int32)
   at System.Data.SQLite.SQLiteStatement.BindParameter(Int32, System.Data.SQLite.SQLiteParameter)
   at System.Data.SQLite.SQLiteStatement.BindParameters()
   at System.Data.SQLite.SQLiteCommand.GetStatement(Int32)
   at System.Data.SQLite.SQLiteDataReader.NextResult()
   at System.Data.SQLite.SQLiteDataReader..ctor(System.Data.SQLite.SQLiteCommand, System.Data.CommandBehavior)
   at System.Data.SQLite.SQLiteCommand.ExecuteReader(System.Data.CommandBehavior)
   at System.Data.SQLite.SQLiteCommand.ExecuteNonQuery(System.Data.CommandBehavior)
   at DataAccess.Sqlite.ExecuteCommand(System.Collections.ObjectModel.Collection`1<System.String>, System.Collections.ObjectModel.Collection`1<System.Data.Common.DbParameter[]>)
   at Data.Settings.Save(System.Collections.ObjectModel.Collection`1<Common.Operation>)
   at DynamicClass.SyncInvokeSaveOperation(System.Object, System.Object[], System.Object[])
   at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(System.Object, System.Object[], System.Object[] ByRef)
   at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(System.ServiceModel.Dispatcher.MessageRpc ByRef)
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(System.ServiceModel.Dispatcher.MessageRpc ByRef)
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(System.ServiceModel.Dispatcher.MessageRpc …
Run Code Online (Sandbox Code Playgroud)

.net c# sqlite wcf interop

12
推荐指数
1
解决办法
1766
查看次数

设置Vertica数据库的默认架构

我正在使用Play构建Web应用程序!使用Vertica数据库作为后端.Vertica的JDBC连接字符串包含服务器和数据库名称,但我的表位于特定模式下(例如"dev_myschema").因此,我应该将我的表称为"dev_myschema.mytable".生产模式中的所有这些表的精确副本(例如"prod_myschema")都包含真实数据.

我想在配置文件中设置此架构名称,以便在这两个架构之间切换.现在,我在一个辅助类中有一个getConnection方法,它执行DB.getConnection()并将配置的模式设置为该连接对象的默认模式.但是,对于其中提及它的实体注释(@Entity @Table(name = dev_myschema.mytable)),其他模型类也没有用.

有没有办法可以在配置文件中指定模式名称,并通过连接方法和模型注释读取它?

谢谢.

jpa vertica playframework

8
推荐指数
2
解决办法
6776
查看次数

将 JVM 堆转储写入标准输出

我们使用以下 JVM 标志在 Docker(由 Kubernetes 管理)中运行 Spring Boot 应用程序

-XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/tmp -XX:+ExitOnOutofMemoryError 
Run Code Online (Sandbox Code Playgroud)

正如预期的那样,容器在 OOM 异常时重新启动。但是,退出时创建的堆转储(在/tmp 中)不再可用,因为容器已重新启动。虽然我们可以映射持久卷,但有没有办法将堆转储写入 STDOUT(因为我们已经从 STDOUT 收集日志)?使用-XX:HeapDumpPath=/dev/stdout结果

*

Dumping heap to /dev/stdout ...
Unable to create /dev/stdout: File exists
Run Code Online (Sandbox Code Playgroud)

*

我在这里缺少一个简单的解决方法吗?

java heap-dump docker

5
推荐指数
1
解决办法
2056
查看次数

标签 统计

.net ×1

c# ×1

docker ×1

heap-dump ×1

interop ×1

java ×1

jpa ×1

playframework ×1

sqlite ×1

vertica ×1

wcf ×1