thanks I deleted and moved to Ask a Question. Thanks
leoiser
Posts
-
Springboot API returns overlapping results for parallel run -
Springboot API returns overlapping results for parallel runHi, I am new to springboot. I created an API which run some process that takes around one hour and return the result. The problem is if I submit two process parallel, I am getting the same output. Pls check the below code and give me suggestions --CONTROLLER
@RestController
@RequestMapping("/task")
public class ProcessController {@Autowired TaskRepository taskRepository; @Autowired ProcessService processService; @RequestMapping(value = "/process", method = RequestMethod.POST, consumes = "application/json", produces = "application/json") public Map process(@RequestBody String requestBody) throws Exception { Map result = new LinkedHashMap(); long taskId=0; try { ParameterClass param =null ; JSONObject requestJson = new JSONObject(requestBody); taskId = Long.valueOf(requestJson.getString("taskid")); List lst = taskRepository.findByTaskId(taskId); Task task = lst.stream().filter(p -> p.getParameterName().equals("process\_task")) .findFirst().orElse(null); if (task != null) { String parameterArgs = task.getParameterArg(); param = setParameters(parameterArgs); //Log process take around one hour result = processService.ProcessJob(param); } } catch (Exception ex) { result.put("taskid", taskId); result.put("status", "failed"); result.put("message", ex.getMessage()); ex.printStackTrace(); } finally { return result; } }
}
--SERVICE
@Service
public class ProcessServiceImpl implements ProcessService {//Oracle DB connection private dataLayer dbLayer = null; //Setting the parameters private ProcessParameter inputParam = null; //Storing output private LinkedHashMap outputResult = null; //storing Log details private StringBuilder sbLog = null; @Override public Map ProcessJob(ProcessParameter param) throws Exception { try { outputResult.put("jobid", param.getTask\_id()); outputResult.put("startdate", new SimpleDateFormat("dd/MM/yyyy hh:mm:ss a").format(System.currentTimeMillis())); sbLog.append("taskid= " + param.getTask\_id() + ")\\n"); inputParam = param; // Initialize the dabaLayer object dbLayer = new dataLayer(param.getServer\_name(), param.getDatasource(), param.getUsername(),param.getPassword()); if (!dbLaye
-
C# windws- Auto increment font sizeNot working. Sorry I did not mention the Button is docked to Full; button1.Dock = DockStyle.Fill; I am always getting the button1's width as 2. Thanks for the reply
-
C# windws- Auto increment font sizeI want to get the maximum font size that can fit to a button.I am loading a Button to a panel.its width and height will vary(dynamically based on some calculations).I want to increase to the maximum font size. For example :- Lets assume that Button size is (100,60) and Text is "AC" (only two letters will come). what should be the maximum font size that can fit in this button. if Button size is (150,250) what should be maximum font size that can fit in this button. Please advice Thanks, Ebin
-
c:\WINDOWS\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets(3397,13): error MSB3073: exited with code 9009Thank you guys! The problem was due to change of the folder.So I deleted the current solution file and created new the solution it works fine. Thanks :laugh:
-
c:\WINDOWS\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets(3397,13): error MSB3073: exited with code 9009Hi all, I converted one web application(Vb.Net) created in VS2005 Framework 2.0 to VS2008 framework 3.5. (This application is using Reportviewer8.0) After convertion I cant build the application,always getting the below error.I use MSBuild to build the application,got the same result.The details of the versions I am using is given below Visual Studio 2008 Version 9.0.30729.1 SP MS Dotnet Framework version 3.5 SP1 OS windows XP cd ..\..\..\..\ DeployMyProj.bat 'DeployMyProj.bat' is not recognized as an internal or external command, operable program or batch file. c:\WINDOWS\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets(3397,13): error MSB3073: The command "cd ..\..\..\..\ c:\WINDOWS\Microsoft.NET\Framework\v3.5\Microsoft.Common.targets(3397,13): error MSB3073: DeployMyProj.bat" exited with code 9009. Done building project "MyProj.vbproj" -- FAILED. ========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ========== If you have any queries please let me know.thanks
-
C# problem in playing swf file in windows applicationhi guys, Anyone knows how to play swf file in windows application.I tried window media player (axWindowsMediaPlayer control). .It is not working sometimes playing half only and then playing from the start.sometimes in middle goes to next swf file.My task is given below for better clarification... I need to get duration of the SWF file.In axWindowsMediaPlayer I am getting the duration as Zero,other file type like avi,wmp,flv I am getting current duration. There is a group of SWF file.its path I stored in an array & playing one by one.After playing all the files I need to do someother task.I also tried Shockwave flash object but dont know how to get duration ,the media end event not to loop etc.... How can I achieve this? Is there any free third party tools available? If give the explanation with the code I will be delighted. Thanks in advance, Ebin
-
Re:Displaying a form window from its (width,0) to (0,0)Now much clear I think.You can do this from your parent form.In parent (let assume form1)form's button (btnForm) click event call the form2 btnForm_Click() ********************** form2 f = new form2() f.size = new Size(100, 100); //set the size of ur form2 f.location= new point(this.Location.X + this.Width -100 , this.Location.Y ); // here 100 is width of form2:) f.Show(); hope this will work for u ... if not pls let me know.Thanks -- modified at 4:51 Friday 17th August, 2007
-
Re:Displaying a form window from its (width,0) to (0,0)I am not clear abt ur issue.I think u want to reverse the form.If u put a control at position (0,10) when u reverse it should display at (width,10). Is it? Can I know why u want to reverse the form?I think it is not possible..not sure. Thanks
-
explicit deletion of objectUse dispose method obj.Dispose(); Thanks
-
Re:Displaying a form window from its (width,0) to (0,0)write the code in ur form this.location = new point(x1+width,y1) Is it solve ur issue? Thanks
-
search for special sentence in a whole string?There are few methods to case sensative searches convert or cast the search field to varbinary Decalre @Code varchar(50) set @Code = 'A22' SELECT Currency.CurrCode, Currency.CurrName FROM CurRate INNER JOIN Currency ON CurRate.Code = Currency.CurrCode where CAST(CurRate.Code as varbinary(50)) = CAST(@Code as varbinary(50)) points to note:- @Code type & size (here varchar(50) should be same as CurRate.Code Hope this will solve your issue. Thanks
-
visitor IP address not gettinghi all, I used Below methods but I am not getting visitors IP.It always shows internal IP.My server having Secure Socket Layer. Request.ServerVariables("HTTP_X_FORWARDED_FOR") //return empty Request.ServerVariables("REMOTE_ADDR") //got my internet IP Request.UserHostAddress //got my internet IP I dont know how to solve this.Is SSL is hiding the visitor IP? When I set deny access IP address in IIS it is working.Actually I want to put access using the visitor IP.How to do this. Pls advice Thanks in Advance.
-
Mutlithreading:-Playing Mutiple Video files CPU 100%hi, Thanks for the reply.When I start the application I am adding control runtime.If I try to play the movie suddenly CPU usage become 100% & the application runs very slowly. Can you suggest is it AxWMPLib.AxWindowsMediaPlayer taking the memory? Every 30 seconds I am updating the screen using Threading.Timer & delegates.So id the screen changes I need to change all the videos. Can you pls help me How I play video with out affecting my screen display & reduce the CPU usage?I am not good in threading.Please give the code... Thanks a lot..
-
How to start C# application along with windows.You can put the exe or Shortcut of the exe in windows startup C:\Documents and Settings\Your Computer Name\Start Menu\Programs\Startup Thanks:-D
-
Mutlithreading:-Playing Mutiple Video files CPU 100%Hi, I am doing an application that is using webservice & displaying data.So every 30 seconds the application will call webservice, I use system.Threading.Timer it is working fine.CPU usage is very less (maximum 30).I got an additional task to play video files.So it will be maximum 8 video in a screen (video files located in local system) & very 30 seconds according to data from ws video file will change.I write the code like this.In timer callback event I am Executing 2 functions [Code] System.Threading.ThreadPool.QueueUserWorkItem(new System.Threading.WaitCallback(GetNextPage), state); // going 2 next page, in a page displaying 8 rows System.Threading.ThreadPool.QueueUserWorkItem(new System.Threading.WaitCallback(GetNextVideo), state); // displaying corresponding video //in delegate of video I put the below code wmp = (AxWMPLib.AxWindowsMediaPlayer)Arrctrl[0]; //Find the control bcos adding at runtime thread = new System.Threading.Thread(new System.Threading.ParameterizedThreadStart(PlayCurrentWMP)); //PlayCurrentWMP is assign the URL & play thread.Priority = System.Threading.ThreadPriority.Lowest; thread.IsBackground = true; thread.Start(wmp); [/Code] Please advice what is wrong in my coding. Thanks in advance :confused:
-
page is not refreshing while accessing WShi all, I ve a problem.I created a user control(Marquee control,logic:-drawing the string at system.Threading.Timer event),it is working fine.When I place the control in one of the form(form is accessing a web service,will take few seconds to get the data),control is not running smoothly.it is hanging for a while (web serice cause the delay).I created a thread & put the WS,Now the form(GUI) is hanging for a while,when it refresh the marquee text is running like Fast forward for a while.It means the marquee is running at the back ground, but I can not see,how to make marquee visible(running smoothly) Thanks in advance, ebin
-
C# + user Control + threading + GUI problemhi all, I ve a problem.I created a user control(Marquee control,logic:-drawing the string at system.Threading.Timer event),it is working fine.When I place the control in one of the form(form is accessing a web service,will take few seconds to get the data),control is not running smoothly.it is hanging for a while (web serice cause the delay).I created a thread & put the WS,Now the form(GUI) is hanging for a while,when it refresh the marquee text is running like Fast forward for a while.It means the marquee is running at the back ground, but I can not see,how to make marquee visible(running smoothly) Thanks in advance, ebin:confused: