Runtime System.Exception when ContextSchemaPath is defined

Offen
#552 11 Kommentare 1 Reaktion 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
42/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Veraltet
Tech-Stack
mysql
Bereich
databases

Rechercherichtung

Beginnen Sie mit dem Verhalten von ContextSchemaPath und dem Stack-Trace-Eintrag FSharp.Data.Sql.Providers.MySql.findClrType@91-1 und reproduzieren Sie anschließend den Datenbankvorgang anhand der aufgeführten Schritte. Als abgeschlossen gilt dies, wenn ein zwischengespeichertes Schema die Nutzung zur Entwurfszeit und zur Kompilierzeit unterstützt, ohne während der Laufzeit-Datenbankvorgänge geladen zu werden, sodass das Einfügen nicht mehr System.Exception: ! auslöst.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Description

When the ContextSchemaPath locally cached schema file is defined and present, SQLProvider returns System.Exception: ! when performing database operations at runtime.

Repro steps
  1. Generate a local schema file with ContextSchemaPath as described in the documentation

  2. Debug the project

  3. Perform a database operation. The following exception is raised:

System.Exception: !
   at FSharp.Data.Sql.Providers.MySql.findClrType@91-1.Invoke(String _arg1)
   at FSharp.Data.Sql.Providers.MySql.createParam[a](String name, Int32 i, a v)
   at <StartupCode$FSharp-Data-SqlProvider>.$Providers.MySql.clo@350-280.Invoke(Tuple`2 tupledArg)
   at Microsoft.FSharp.Collections.SeqModule.Fold[T,TState](FSharpFunc`2 folder, TState state, IEnumerable`1 source)
   at FSharp.Data.Sql.Providers.MySqlProvider.createInsertCommand(IDbConnection con, StringBuilder sb, SqlEntity entity)
   at <StartupCode$FSharp-Data-SqlProvider>.$Providers.MySql.FSharp-Data-Sql-Common-ISqlProvider-ProcessUpdates@949-3.Invoke(SqlEntity e)
   at Microsoft.FSharp.Collections.SeqModule.Iterate[T](FSharpFunc`2 action, IEnumerable`1 source)
   at FSharp.Data.Sql.Providers.MySqlProvider.FSharp-Data-Sql-Common-ISqlProvider-ProcessUpdates(IDbConnection con, ConcurrentDictionary`2 entities, TransactionOptions transactionOptions, FSharpOption`1 timeout)
   at <StartupCode$FSharp-Data-SqlProvider>.$SqlRuntime.DataContext.f@1-69(SqlDataContext __, IDbConnection con, Unit unitVar0)
   at FSharp.Data.Sql.Runtime.SqlDataContext.FSharp-Data-Sql-Common-ISqlDataContext-SubmitPendingChanges()
   at MyProject.DoDatabaseStuff(DbRow _row) in C:\Users\Me\Code\MyProject\Db.fs:line 65
Stopped due to error
Expected behavior

The type provider should not attempt to load the ContextSchemaPath at runtime since it is not a data source and will never work. It should only load at design-time and compile-time to allow development and compilation (build server) without a full-time database connection.

Known workarounds

Workarounds are to either not use the ContextSchemaPath at all, or delete the cached schema file each time debugging is needed.

Related information
  • Used database: MySQL 5.6
  • Operating system Window 10 version 1803
  • Branch: 1.1.42
  • .NET Runtime: 4.5.2
  • Performance information, links to performance testing scripts : N/A
Vorherrschende Sprache
F#
Sterne
627
Forks
147
Ø Merge
2 Std. 2 Min.
Gemergte PRs (30 T.)
1

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus fsprojects/SQLProvider

Alle Issues in fsprojects/SQLProvider

Ähnliche Issues

Weitere Issues zu Databases

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.