I was developing a simple Spring MVC application that invokes a Web Service over a JMS trasport. I need to deploy it on websphere application server. Everything seems to work fine when I reference the remote connection factory directly from my application, and even seems to work properly when I try to use a local JNDI Queue connection factory on my WAS, but then, I cannot shutdown my server.
It seems to be because its connections pool keeps locked by somebody. It never invokes Session.close over JMS session (it is managed by JAX-WS server framework, in this case Apache Axis2). I have done the same from an even simpler spring MVC application (just #Controller and views) and it stops fine. The application that makes pool to be locked just includes a more complex context with persistence and transaction management (annotation-driven).
Do you think that this transaction mananagement could affect JMS session management? Somebody have ever found a JMS connection pool locked by an spring application?
Thanks.
Regards.
That was the solution to avoid locking. We removed ServletContext.close, so our server can find the references to used resources, and can release connections on pool.
Related
I am using ServiceClient to access data in dataverse from a c# application. The application is a worker service and the service client is injected into the application using dependency injection as a singleton. I am seeing the service client cache results. Is there a work around for this. If I update the record in dataverse my application continues to pull the old data.
It appears since my context was a singleton I needed to detatch any records that I may have already queried.
i'm piecing together EF and DI, i have a beginners understanding in it and im trying to solve for the following (in the one solution);
I have a web app (blazor web assembly) which has two projects (Client / Server)
I have a separate console app which will run off a service bus queue and needs to interact with the EF model in the server project
The solution is multi-tenant, so i send the client ID as a part of the request to the console app which will tell the app (and dbContext) which tenant DB to connect to
i have added the server project reference to the console app, and what i have the console app currently listening to a service bus queue and executing the required processing with dummy stub data.
what i need help with is how to setup the console app in .net6.0 to;
establish a transient DI database dbContext which uses the other project EF model AND establishes a tenant db connection on each execute (service bus post)
as a result of the processing i may need to also send a request to another service bus queue for other processing / actions / etc.
so i'm assuming a singleton service for that....???
i know the model, just not sure on how to code...
it's fairly simple and would probably take a dev about 15 minutes to configure... i'm not a good dev though :D
I have an Azure fabric cluster with .NET core 2.2 micro services inside of it. The mentioned services use EF core for communicating with Azure SQL databases. Also, the fabric cluster is behind a load balancer.
The database context has a scoped lifetime and is injected into the controllers using dependency injection.
Everything works well when the services are queried consistently by the same client, since the load balancer guarantees that for at least 4 minutes the same user will be sent to the same service instance. However, when the load balancer decides to send the user to a different instance, the database context is created again (since the lifetime is scoped, it means that a context is created per new web request). Unfortunately, the model building process takes quite long and due to that reason the first query is always way slower than the subsequent ones (on the same web request).
The questions would be, is it possible to somehow cache the EF Core model, so that it wouldn't have to be rebuilt every time the situation described above occurs ?
I mean, a similar procedure to EF - where an .edmx file is created once and loaded on context creation.
As of 3/3/2020 https://github.com/dotnet/efcore/issues/1906 this is still not possible.
If you need model caching for performance reasons you will need to use EF 6. The good news is that EF 6.3 and the the SQL Server provider for EF 6 were ported over to run on .net core 3.0. However other providers may or may not port their code over so support may be spotty.
https://devblogs.microsoft.com/dotnet/announcing-ef-core-3-0-and-ef-6-3-general-availability/#what-s-new-in-ef-6-3
I'm running an application which has a background process which runs every 5 minutes. It runs in a clustered environment (WAS 7.1) but the process should only run on one server at a time. For this reason I've opted for EJB Timer using the javax.ejb.TimedObject interface. The timer is initially scheduled via a Web application (Spring MVC) in the same EAR. This has been running fine for over a year.
Recently I have upgraded the application to Spring 3.2.4 and made use of profiles. Now when the server recreates the EJB as part of it's lifecycle it sometimes is complaining that it cannot find one of the bean definitions. This bean happens to be defined twice, once withing a beans tag with a profile of 'live' and another with 'test'. The Web Application that initially schedules the timer uses a contexParam in the web.xml of 'spring.profiles.active' set to 'live'. This ensures the timer initially starts with the 'live' configuration. I suspect that when the server recreates the EJB it is recreating the spring context but the profile parameter is being lost somewhere.
Has anyone come across this before or have any suggestions as to how this might be solved?
Thanks in advance.
I have a wcf service and i want to call a method automatically , immediately after the publishing in IIS. Like an initialization of the WCF service without having to call the method manually or from somewhere else. Where should i place my Initialize method in WCF Service in order to run exactly after the start of the application?
If you're hosting in IIS you can use the application_start event within the Global.asax of the web app that hosting tHE WCF service to do any application initialization. If you are trying to call one of your services when it is first installed then this is likely the wrong approach.
What is the motivation for running some code on start up of the web service? If you are trying to get around a slow initial call to the WCF service I suggest you would want to do some work on the WCF client-side rather than in the service...but Im just guessing at your motivation here
Initialization of the WCF service? So do you have singleton service or do you want to initialize some global state? Otherwise initialization doesn't make sense because service instances will be created for actual clients.
By default IIS starts application when it is accessed first time. If you place initialization in Application_Start (HttpApplication or Global.asax) the code will run when the application is first accessed. But accessing the service is not something that your application can initiate.
IIS 7.5 (Windows 2008 R2) has warm-up module which can run some code when pool is recycled or worker is restarted. If you use other version of IIS you have to use some external solution like custom application pinging your service in regular intervals.