rivantsov / vita

VITA Application Framework
MIT License
59 stars 15 forks source link

Data Cache #166

Closed rubenalves closed 3 years ago

rubenalves commented 3 years ago

Hello Roman

Are still working Data Cache? I hade to move back to version 1.9.3.1 because i was having lots of problems , 1.9.3 is working fine for me, but probably GraphQL only works with 3.x

Thanks.

rivantsov commented 3 years ago

DataCache - it is in the plans and todo list, but not at the moment, there are several things I think need to be done before it, and DataCache is dependent on these - like LinqEngine, authorization concepts, masking and column tracking, internal record's data storage etc. Are you saying that v3 does not work for you mostly because there's no data caching? that sound strange... and alarming. It might be there are some really inefficient calls in your code that are unacceptably slow without cache. That should not be the situation I think. Let's work on these pieces, maybe I can help? The data cache will be coming, just so much stuff on my plate right now, and there things that MUST go before cache..

rubenalves commented 3 years ago

For me no problema, my app was built to work with datacache as it is open all day and sometimes for several days on a POS system and after a fiew hours it starts to get problms, i will use vita 3.x for new projects and stay with 1.9 on this one with no problems.

Thanks for your time.

Com os melhores cumprimentos,

Ruben Alves Móvel: 916887379 Email: ruben.alves@outlook.pt

De: Roman Ivantsov notifications@github.com Enviada: 13 de fevereiro de 2021 16:18 Para: rivantsov/vita vita@noreply.github.com Cc: rubenalves ruben.alves@serreta.net; Author author@noreply.github.com Assunto: Re: [rivantsov/vita] Data Cache (#166)

DataCache - it is in the plans and todo list, but not at the moment, there are several things I think need to be done before it, and DataCache is dependent on these - like LinqEngine, authorization concepts, masking and column tracking, internal record's data storage etc. Are you saying that v3 does not work for you mostly because there's no data caching? that sound strange... and alarming. It might be there are some really inefficient calls in your code that are unacceptably slow without cache. That should not be the situation I think. Let's work on these pieces, maybe I can help? The data cache will be coming, just so much stuff on my plate right now, and there things that MUST go before cache..

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/rivantsov/vita/issues/166#issuecomment-778648004, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AB7ISPWXAX35YUXTV7TVN73S62X3ZANCNFSM4XQVA4LA.

rubenalves commented 3 years ago

Hello,

Any news on Data Cache?

I hve upgraded my application to Vita 3.1.1 and it is working as expected even without Cache enabled, but in prduction i am geting a exeption

===========Start============= 18/05/2021 23:58:09 Error Message: System.IO.FileLoadException: Não foi possível carregar o ficheiro ou assemblagem 'Microsoft.Identity.Client, Version=4.21.1.0, Culture=neutral, PublicKeyToken=0a613f4dd989e8ae' ou uma das respectivas dependências. A definição do manifesto de assemblagem localizada não corresponde à referência de assemblagem. (Excepção de HRESULT: 0x80131040) Nome de ficheiro: 'Microsoft.Identity.Client, Version=4.21.1.0, Culture=neutral, PublicKeyToken=0a613f4dd989e8ae' em Microsoft.Data.SqlClient.ActiveDirectoryAuthenticationProvider..ctor(String applicationClientId) em Microsoft.Data.SqlClient.SqlAuthenticationProviderManager..cctor()

AVI: O registo do enlace de assemblagem está DESACTIVADO. Para activar o registo de falhas de enlace, defina o valor de registo [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) como 1. Nota: Existe algum tipo de penalização no desempenho associado ao registo de falhas de enlace de assemblagem. Para desactivar esta funcionalidade, remova o valor de registo [HKLM\Software\Microsoft\Fusion!EnableLog].

Stack Trace: em Microsoft.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, ServerCertificateValidationCallback serverCallback, ClientCertificateRetrievalCallback clientCallback, DbConnectionPool pool, String accessToken, SqlClientOriginalNetworkAddressInfo originalNetworkAddressInfo, Boolean applyTransientFaultHandling) em Microsoft.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions) em Microsoft.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnection owningObject, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions) em Microsoft.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection) em Microsoft.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection) em Microsoft.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection) em Microsoft.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection) em Microsoft.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection) em Microsoft.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource1 retry, DbConnectionOptions userOptions) em Microsoft.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource1 retry, DbConnectionOptions userOptions) em Microsoft.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource1 retry) em Microsoft.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource1 retry, SqlConnectionOverrides overrides) em Microsoft.Data.SqlClient.SqlConnection.Open(SqlConnectionOverrides overrides) em Microsoft.Data.SqlClient.SqlConnection.Open() em Vita.Data.DbExtensions.CheckConnectivity(DbDriver driver, String connectionString) em Vita.Data.DbExtensions.CheckConnectivity(DbSettings dbSettings, Boolean rethrow) em Vita.Entities.EntityApp.ConnectToDatabase(DbSettings dbSettings) em Vita.Entities.EntityApp.ConnectTo(DbSettings dbSettings) em TsGest.DL.TsGestConfig.Configure(String connectionString, TipoDb tipoDb) ===========End============= 18/05/2021 23:58:09 ===========Start============= 18/05/2021 23:58:09 Error Message: Stack Trace: em System.Diagnostics.EventLog.FindSourceRegistration(String source, String machineName, Boolean readOnly, Boolean wantToCreate) em System.Diagnostics.EventLog.SourceExists(String source, String machineName, Boolean wantToCreate) em System.Diagnostics.EventLogInternal.VerifyAndCreateSource(String sourceName, String currentMachineName) em System.Diagnostics.EventLogInternal.WriteEntry(String message, EventLogEntryType type, Int32 eventID, Int16 category, Byte[] rawData) em System.Diagnostics.EventLog.WriteEntry(String message, EventLogEntryType type, Int32 eventID) em TsGest.DL.TsGestConfig.RegistarErroEvento(String message, String s, Int32 id) ===========End============= 18/05/2021 23:58:09 ===========Start============= 18/05/2021 23:58:09 Error Message: System.IO.FileLoadException: Não foi possível carregar o ficheiro ou assemblagem 'Microsoft.Identity.Client, Version=4.21.1.0, Culture=neutral, PublicKeyToken=0a613f4dd989e8ae' ou uma das respectivas dependências. A definição do manifesto de assemblagem localizada não corresponde à referência de assemblagem. (Excepção de HRESULT: 0x80131040) Nome de ficheiro: 'Microsoft.Identity.Client, Version=4.21.1.0, Culture=neutral, PublicKeyToken=0a613f4dd989e8ae' em Microsoft.Data.SqlClient.ActiveDirectoryAuthenticationProvider..ctor(String applicationClientId) em Microsoft.Data.SqlClient.SqlAuthenticationProviderManager..cctor()

AVI: O registo do enlace de assemblagem está DESACTIVADO. Para activar o registo de falhas de enlace, defina o valor de registo [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) como 1. Nota: Existe algum tipo de penalização no desempenho associado ao registo de falhas de enlace de assemblagem. Para desactivar esta funcionalidade, remova o valor de registo [HKLM\Software\Microsoft\Fusion!EnableLog].

Stack Trace: em Microsoft.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData, ServerCertificateValidationCallback serverCallback, ClientCertificateRetrievalCallback clientCallback, DbConnectionPool pool, String accessToken, SqlClientOriginalNetworkAddressInfo originalNetworkAddressInfo, Boolean applyTransientFaultHandling) em Microsoft.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions) em Microsoft.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnection owningObject, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions) em Microsoft.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection) em Microsoft.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection) em Microsoft.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal& connection) em Microsoft.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource1 retry, DbConnectionOptions userOptions, DbConnectionInternal& connection) em Microsoft.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal& connection) em Microsoft.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource1 retry, DbConnectionOptions userOptions) em Microsoft.Data.ProviderBase.DbConnectionClosed.TryOpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource1 retry, DbConnectionOptions userOptions) em Microsoft.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource1 retry) em Microsoft.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource1 retry, SqlConnectionOverrides overrides) em Microsoft.Data.SqlClient.SqlConnection.Open(SqlConnectionOverrides overrides) em Microsoft.Data.SqlClient.SqlConnection.Open() em Vita.Data.DbExtensions.CheckConnectivity(DbDriver driver, String connectionString) em Vita.Data.DbExtensions.CheckConnectivity(DbSettings dbSettings, Boolean rethrow) em Vita.Entities.EntityApp.ConnectToDatabase(DbSettings dbSettings) em Vita.Entities.EntityApp.ConnectTo(DbSettings dbSettings) em TsGest.DL.TsGestConfig.Configure(String connectionString, TipoDb tipoDb) ===========End============= 18/05/2021 23:58:09

Any idea of what can be the problem? I think it is because of using Microsoft.Data.SqlClient and not System.Data.SqlClient.

The new version is very good :)

rivantsov commented 3 years ago

well, after going thru Google translate (I am no good in Portuguese, you know -), it looks like a typical assembly/package version mismatch. Read here as just one of many places it is described: https://docs.microsoft.com/en-us/dotnet/framework/configure-apps/redirect-assembly-versions In practical steps, what I usually do:

  1. Enable auto-gen binding redirects : https://docs.microsoft.com/en-us/dotnet/framework/configure-apps/how-to-enable-and-disable-automatic-binding-redirection
  2. Add explicit reference to Microsoft.Data.Client package, latest version in your app

If it works in dev, but fails in prod, probably there are some restrictions in prod env, try to find out what it can be, mostly Google is the way to go.

rubenalves commented 3 years ago

Hello,

I found the problem, the i usualy delete the .config files and if i delete the main file .exe.config file it gives a exception, o i just need to leave it alone and every thing is fone,

Vita Rocks :)

rubenalves commented 2 years ago

Hello, Happy Easter, Almost a Year passed and no news, is there any planes on DataCache? Are There plans on gatting sotored proceddores back?

Looks like the project is not very active at the moment.

version 1.9 was the best orm ever, after that lots of the good stuff is gone, hope that auto database updates are not going away also.

rivantsov commented 2 years ago

Hi thank you, Happy Easter back. Sorry for long silence, yes, I am less active here, trying to catch up on all fronts, specifically in NGraphQL. We finally have decent web data communication protocol - GraphQL! So we actually have the entire app stack now (db -> ORM-> biz -> GraphQL), that's what I am trying lift up and integrate VITA+GraphQL, to have the real power up. I am still on it, including VITA, doing some experiments and drafts, you just do not see it in public repo.
Again, all I can do is promise - but seriously, once I am done with one another thing (almost there), will be back in VITA. As for good things in 1.9 - thanks, but the truth is, the implementation of these things was far from perfect under the hood, the ugly patches started to accumulate, and that's the main reason I removed them in new refactored version, and did not bring back - yet; the impl is just too ugly and more trouble than it's worth, trust me. I have a new design, will implement it eventually.

About stored procs - what do you mean 'back'? stored procs were for doing CRUD things, they were ugly workaround that allowed to implement a decent batch mode for SaveChanges. In new version, they are gone since VITA can do batches with dynamic SQL now. I did not plan to bring these procs back. They were pain in the butt to maintain. Other procs - maybe easy facilities to call/execute extra hand-written procs - that might come, eventually.

Still, why you need cache so much. I understand it helps, but in general, VITA performs very well even without cache (there's a lot of things cached by SQL Server, so it helps offset lack of caching in VITA.

thanks again, I am still here, working on it Roman