Java自学者论坛

 找回密码
 立即注册

手机号码,快捷登录

恭喜Java自学者论坛(https://www.javazxz.com)已经为数万Java学习者服务超过8年了!积累会员资料超过10000G+
成为本站VIP会员,下载本站10000G+会员资源,会员资料板块,购买链接:点击进入购买VIP会员

JAVA高级面试进阶训练营视频教程

Java架构师系统进阶VIP课程

分布式高可用全栈开发微服务教程Go语言视频零基础入门到精通Java架构师3期(课件+源码)
Java开发全终端实战租房项目视频教程SpringBoot2.X入门到高级使用教程大数据培训第六期全套视频教程深度学习(CNN RNN GAN)算法原理Java亿级流量电商系统视频教程
互联网架构师视频教程年薪50万Spark2.0从入门到精通年薪50万!人工智能学习路线教程年薪50万大数据入门到精通学习路线年薪50万机器学习入门到精通教程
仿小米商城类app和小程序视频教程深度学习数据分析基础到实战最新黑马javaEE2.1就业课程从 0到JVM实战高手教程MySQL入门到精通教程
查看: 523|回复: 0

EF sqlite3报错 "System.Data.Entity.Core.EntityException: 在提供程序连接上启动事务时出错。有关详细信息,请参阅内部异常。

[复制链接]
  • TA的每日心情
    奋斗
    昨天 22:25
  • 签到天数: 790 天

    [LV.10]以坛为家III

    2049

    主题

    2107

    帖子

    72万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    积分
    722766
    发表于 2021-6-25 14:33:56 | 显示全部楼层 |阅读模式

    问题:sqlite3使用ef框架操作数据库报错

    问题原因:数据库文件没有访问权限

    结局方案:可以将数据库文件所在的文件夹的访问权限添加Everyone用户权限。

     

    错误:"System.Data.Entity.Core.EntityException: 在提供程序连接上启动事务时出错。有关详细信息,请参阅内部异常。 ---> System.Data.SQLite.SQLiteException: attempt to write a readonly database\r\nattempt to write a readonly database\r\n 在 System.Data.SQLite.SQLite3.Reset(SQLiteStatement stmt)\r\n 在 System.Data.SQLite.SQLite3.Step(SQLiteStatement stmt)\r\n 在 System.Data.SQLite.SQLiteDataReader.NextResult()\r\n 在 System.Data.SQLite.SQLiteDataReader..ctor(SQLiteCommand cmd, CommandBehavior behave)\r\n 在 System.Data.SQLite.SQLiteCommand.ExecuteReader(CommandBehavior behavior)\r\n 在 System.Data.SQLite.SQLiteCommand.ExecuteNonQuery(CommandBehavior behavior)\r\n 在 System.Data.SQLite.SQLiteCommand.ExecuteNonQuery()\r\n 在 System.Data.SQLite.SQLiteTransaction.Begin(Boolean deferredLock)\r\n 在 System.Data.SQLite.SQLiteTransactionBase..ctor(SQLiteConnection connection, Boolean deferredLock)\r\n 在 System.Data.SQLite.SQLiteTransaction..ctor(SQLiteConnection connection, Boolean deferredLock)\r\n 在 System.Data.SQLite.SQLiteConnection.BeginDbTransaction(IsolationLevel isolationLevel)\r\n 在 System.Data.Common.DbConnection.BeginTransaction(IsolationLevel isolationLevel)\r\n 在 System.Data.Entity.Infrastructure.Interception.DbConnectionDispatcher.<BeginTransaction>b__0(DbConnection t, BeginTransactionInterceptionContext c)\r\n 在 System.Data.Entity.Infrastructure.Interception.InternalDispatcher`1.Dispatch[TTarget,TInterceptionContext,TResult](TTarget target, Func`3 operation, TInterceptionContext interceptionContext, Action`3 executing, Action`3 executed)\r\n 在 System.Data.Entity.Infrastructure.Interception.DbConnectionDispatcher.BeginTransaction(DbConnection connection, BeginTransactionInterceptionContext interceptionContext)\r\n 在 System.Data.Entity.Core.EntityClient.EntityConnection.<>c__DisplayClass6.<BeginDbTransaction>b__4()\r\n 在 System.Data.Entity.Infrastructure.DefaultExecutionStrategy.Execute[TResult](Func`1 operation)\r\n 在 System.Data.Entity.Core.EntityClient.EntityConnection.BeginDbTransaction(IsolationLevel isolationLevel)\r\n --- 内部异常堆栈跟踪的结尾 ---\r\n 在 System.Data.Entity.Core.EntityClient.EntityConnection.BeginDbTransaction(IsolationLevel isolationLevel)\r\n 在 System.Data.Entity.Core.EntityClient.EntityConnection.BeginTransaction()\r\n 在 System.Data.Entity.Core.Objects.ObjectContext.ExecuteInTransaction[T](Func`1 func, IDbExecutionStrategy executionStrategy, Boolean startLocalTransaction, Boolean releaseConnectionOnSuccess)\r\n 在 System.Data.Entity.Core.Objects.ObjectContext.SaveChangesToStore(SaveOptions options, IDbExecutionStrategy executionStrategy, Boolean startLocalTransaction)\r\n 在 System.Data.Entity.Core.Objects.ObjectContext.<>c__DisplayClassb.<SaveChangesInternal>b__8()\r\n 在 System.Data.Entity.Infrastructure.DefaultExecutionStrategy.Execute[TResult](Func`1 operation)\r\n 在 System.Data.Entity.Core.Objects.ObjectContext.SaveChangesInternal(SaveOptions options, Boolean executeInExistingTransaction)\r\n 在 System.Data.Entity.Core.Objects.ObjectContext.SaveChanges(SaveOptions options)\r\n 在 System.Data.Entity.Internal.InternalContext.SaveChanges()\r\n 在 System.Data.Entity.Internal.LazyInternalContext.SaveChanges()\r\n 在 System.Data.Entity.DbContext.SaveChanges()\r\n 在 APPAPI.Method.MedToken.UserLoginToken(String account)",

     

    哎...今天够累的,签到来了1...
    回复

    使用道具 举报

    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    QQ|手机版|小黑屋|Java自学者论坛 ( 声明:本站文章及资料整理自互联网,用于Java自学者交流学习使用,对资料版权不负任何法律责任,若有侵权请及时联系客服屏蔽删除 )

    GMT+8, 2024-9-11 05:12 , Processed in 0.057872 second(s), 29 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2021, Tencent Cloud.

    快速回复 返回顶部 返回列表