EntityNotFoundException: There is no such an entity. Entity type: Volo.Abp.OpenIddict.Applications.OpenIddictApplication - abp

Screenshot of the problem
ABP Framework: preview 6.0.0-rc2
Application / Angular / Entity Framework Core / MySQL
Separate Identity Server
I have this problem while logging in, how can it be fixed? thank you

Sometimes you have multiple requests arrive to server, one of them may delete the item, so the GetAsync function may throws EntityNotFoundException
The safest simplest way is to get first or default, and check if it is null or not

Related

Azure Form Recognizer - Copy model from QA to PROD

Our team has built more than 1000+ models in development environment and tested the output. We moved the models from QA to Production using StartModelCopyTo method using Form Recognizer client SDK. During each copy model, code is written such a way that if PercentageCompleted is 100%, then move to next model. All 1000+ models copied to production service. Now the problem is, when we use GetCustomModels method to list all models, all models comes as null, but if I use model Id, it returns all details. Has anyone faced this issue? Business team considers this as an issue and not ready to sign off. We are facing other issues with the Form Recognizer service too.
This could be related to the SDK/REST API version you are using for the get operation. Can you validate that you are using the API version and SDK that corresponds to the V2.1 or v3 API based on which version the mode was trained with?
Direct message if you are still having trouble.
Microsoft support came back and said that copy model method has threshold of 1 per minute. Now we created a delay of 1 per minute and it works.

Access Sitecore DB from API in Console application

I would like to accesss the sitecore DB and items from console application like
Sitecore.Data.Database db = Sitecore.Context.Database
or
Sitecore.Data.Database db = Sitecore.Data.Database.GetDatabase("master")
how do I configure and setup my console application to access the DB as above?
Thanks Everyone for the suggestion, I am really interested in config changes, I used webservice, but it has very limited methods. For example, if I would like create an Item with the template and insert the item with prepopulated value, there is no such option. The reason I am looking for the console apporach is I would like to import the contents from XML or excel sheet and push those to the sitecore tree, eventually use the scheduled task to run the console app periodically. I do not want to copy the entire web.config and app_config. If anyone has already done this, could you please post your steps and necessary config changes?
You have two options I think:
1) Import the Sitecore bits of a website's web.config into your console application's app.config, so that the Sitecore API "just works"
I'm sure I read a blog post about this, but I can't find the reference right now. (I will have another look) But I think the simple but long winded approach is to copy all of the <sitecore/> element and all the separate files it references. I'm fairly sure you can whittle this down to a subset of the config required for data access with a bit of thinking.
2) Don't use the Sitecore API directly, connect to a web service that exposes access to it remotely.
There are a few of these that already exist. Sitecore itself exposes one, Sitecore Rocks has one, and Hedgehog TDS has one too. And you can always write your own (since any web service running inside the Sitecore ASP.Net app can make database calls and report values back and forth - just remember to consider security if this web service might end up exposed externally for any reason)
John West links to some relevant stuff here:
http://www.sitecore.net/Learn/Blogs/Technical-Blogs/John-West-Sitecore-Blog/Posts/2013/09/Getting-Data-Out-of-the-Sitecore-ASPNET-CMS.aspx
-- Edited to add --
I've not found the blog post I remember. But I came across this SO thread:
Accessing Sitecore API from a CLI tool
which refers to this blog post:
http://www.experimentsincode.com/?p=232
which I think gives the info you'll need for option 1.
(And it reminds me that, of course, when you copy the config stuff you have to copy the Sitecore binaries into your app's folder as well)
I would just like to expand on #JermDavis' post and note that Sitecore isn't a big fan of being accessed when not in a web application. However, if you still want to do this, you will need to make sure that you have all of the necessary configuration settings from the web.config and App_Config of your site in your console application's app.config file.
Moreover, you will never be able to call Sitecore.Context in a console application, as the Sitecore Context sits on top of the HttpContext which means that it must be an application and have a valid request for you to use it. What you are looking for is something more along the lines of Sitecore.Configuration.Factory.GetDatabase("master").
Good luck and happy coding :)
This sounds like a job for the Sitecore Item Web API. I use the Sitecore Item Web API whenever I need to access Sitecore data from the master database outside the context of the Content Management server or outside of the context of the Sitecore application. The Web API definitely does not allow you to do everything that the standard Sitecore API does but it can act as a good base and I now extend upon the Web API instead of writing my own custom web services whenever possible.
Thanks to JemDavis's advise.
After I copied the configuration and made changes to config section to get rid of conflicts. I copied almost all of Sitrecore, analytics and lucene dlls, it worked great.
Only thing you have to remember is, copy the app_config folder to the same location where your dlls are.
Thanks again JemDavis....

Which Database Can be Used With Chrome Extension

I am trying to create a Google Chrome Extension which Needs to store Data from users for login authentication. Can you please advise me which Database I can try to have with the app? I already tried the SQLite but I am not sure that end users can update the tables by inserting or deleting rows? I also saw some posts about Web Databases but didn't find any thing really useful for it! now my question is:
1- Is SQLite capable to be updated by end users(While eht do not have SQLite on their Machine?)
2- If not, what kind of Secure database I can use instead?
Thanks,
In an extension you can use webDB (apps cannot, however), indexedDB, localStorage and/or the chrome.storage api. The later has the added bonus of not being visible if an end user figures out how to inspect your extension with devtools. If you're worried about credentials being stored as plain text, you can always find a js crypto Implementation somewhere.
This seems like a repeat of the question : Connecting to DB from a Chrome Extension?.
It basically says you should use an intermediary webapp for db calls, and use AJAX to communicate between the chrome extension and that app.

RIA services and nHibernate insert new problem

I have combination of RIA services and nHibernate. nHibernate is configured to use identity on database side. So new Entities are sent with 0 for id. nHibernate works as it should. It updates generated keys form database and updates entites.
I have example with compositional hierarchy. My entity is complex it has two collections.
InvestObject
- MaterialItems
- WorkItems
I work with this structure in one unit of work. Geting and showing data in Silverlight app is no problem. But if I try to add more than one item in MaterialItems collection on client side, when saving I get this error:
Submit operation failed. Invalid
ChangeSet : Only one entry for a given
entity instance can exist in the
ChangeSet. at
System.ServiceModel.DomainServices.Server.ChangeSet.ValidateChangeSetEntries(IEnumerable1
changeSetEntries) at
System.ServiceModel.DomainServices.Server.ChangeSet..ctor(IEnumerable1
changeSetEntries)
There is a quick fix on client side, just to generate some dummy negative ids, for Material. This works for RIA and save is propagated to server side. But then nHibernate fires error, beacuse it expects 0 for all new Ids not a given value ( ). So this is not OK.
Finally I tricked nHibernate by reseting back all new Ids to 0. But this does not make me happy. It is messy ugly solution.
Please help
It's been a while since I've done this so the details are hazy but I think you basically can't use IDs that are generated in the DB with RIA services. We used the HiLo algorithm instead.

Need advice for my Server part

I'm stuck on my server part.
I thing it would be fine if I make an REST architecture but I'm not sure.
My application is that an identitied user edit his name, age, hobbies...and I want to stock all the informations of all the users on my data server. Then, I could send the information of a user to another in a ListView with an adaptater.
Any idea to help me?
Thanks in advance
I have recently added a series of posts to my blog that may help. It covers creating a RESTful service using Java EE technologies on the GlassFish server. The example produces consumes XML, but could easily be adapted to handle JSON.
Part 1 - The Database Model
Part 2 - Mapping the Database Model to JPA Entities
Part 3 - Mapping JPA Entities to XML using JAXB
Part 4 - The RESTful Service

Resources