Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!

Ugender Rekulampally

Ranch Hand
+ Follow
since Nov 14, 2005
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Ugender Rekulampally

I fixed it by using createNativeQuery instead of createQuery on EntityManager.
I need some help with converting SQL to HQL.

here is the query. (please know that I can't use createSQLQuery on EntityManager)



Above CountEntity is entity version of Count table.


Right now I am getting this error: ERROR org.hibernate.hql.PARSER - 18120 line 2:33: unexpected token: (

any suggestions?
I figured this out. Just in case someone else needs the solution, here it is





I need some help with HTML display.

I need to display a list of skill names (these I am getting from a RESTful call) and user should be able to do multiple selections from this list. I also need to capture the user selections (multiples that user selected).

And here is what I am doing:

I am able to make RESTful call successfully in my controller (Angular), and I am able to display the 4 strings that I am receiving, as shown below






My problem is using the ng-repeat, how do I show these 4 strings and if user selects a multiple items in the display how do I capture the user selected values?




Any thoughts, help?




As mentioned above, w3schools is pretty good, and also try to look into HeadFirst HTML 5/Java Script.
Sagar,

It worked. Thanks.

I used if statement inside the for loop. I am sure you also meant that way only.



Thanks.
Ugender
11 years ago
Hi All,
I have a jsp page which displays valus by reading a list objects. it workd fine when the list has values. but when the list is empty, I see below error message.




I have a drop down also there in my code to display ...can some one have a look at my code and see why it is even going into the loop when the size is zero (0)?


Here is the code





even i tried having a 'IF' condition saying enter the 'for' loop only when the list size is more than zero. I dont see the print out statement in the 'IF' loop when the list size is zero but i get the error saying 'indexedWorkInProgressVO' cant be find. I am guessing this is something to do with the drop down list? <html:select>? can any one give me some guidence to how to go about?

Thanks,
Ugender
11 years ago
Hi All,

I have one element in XSD which has default value. When I generate JAXB objects using that XSD, that default value is not being assigned to the getMyElementValue() ..

Here is the sample element in my XSD




and I was expecting getSORID() value will be "07" when I don't have any value for my "SORID" element in my XML file.


Is some thing wrong with my XJC compilor or is any other reason?

I really appreciate your thoughts and help on this.


Thanks,
Ugender Rekulampally
Nitesh,

I am with you. We all know how well you answer here. Keep up the good work and help us out.

Thanks,
Ugender
Robert,
I think you are allowed to fork threads in MDB (onMessage) but not recommended. I think you want to make multiple threads in onMessage() to share the load to process the message to speed it up. But I think instead of you creating multiple threads, you split the message before you even place on the queue and modify your onMessage() according to the small message and that will give the same effect and its safe way too.

But WebLogic and websphere don't recommend to create multiple threads in their app server containers.

Why do you want to create multiple threads in there? can you explain a bit more?

Thanks,
Ugender
Branislav,
The output you showed will also vary on how those two threads run first/fast.

In your output, if you wanted to see this line

gets executed, then you could use a 'break' after your System.out.println("ms.wait()"). the reason is count is already 10000 and variable 'i' still not reached to 10000 so loop is going to run even after wait() is done and it is going to wait() again. in this case, no one notify() ing again to get the wait() out till variable 'i' reaches 10000 (+1).

Lets assume Notifier thread runs and executes below code



before Job1 Thread gets to this below code



Then you will see different output. the reason is your Notifier gets the lock on ms and notifies before Job1 gets the lock.

So in this situation, you dont even see "ms.wait()" print statement also because there is no one notifying this thread at all. and it will wait() forever.

What exactly you wanted to see in your output?


Thanks,
Ugender
Chad,
I recently did same kind of work. Even I too was enhancing a plain java program which also processes millions of records at times.

Anyways, Here are some of answers you are looking for.

1) Either declare certain number of thread count in your config file and read from it or you can hardcode a variable with certain number of threads in your program. But declaring in config file makes your life better. even if you want to change in production, that won't be a code change.

See some of my code snippet.


So that is how I handled it. See if this can help you

2) to asnwer your question 2, just join the threads you created and that will make sure that all the threads are done.




Once your control comes after this for loop means all of your threads are done processing.

3) Probably I am not sure how to come up with solution for this one but what do you mean by hung threads? if thread is processing, some thing goes wrong then it should throw some exception and make your decision there what to do with it.

again, for parent and child thread issue should be taken care by join() method.

May be some one else will shed some more light on this.


Thanks,
Ugender
Manimekala,
Sure there may be different ways but is your program working as you expected? we only saw just two methods and didn't see how you are handling them or calling them.

Thanks,
Ugender
Manimekala,

I don't think your synchronization in methods are correct.



Here why do you have myList.notifyAll()? I am assuming you wanted this method to be accessed by one thread at time and once it is done, that is it. you don't have to call notifyAll() to tell every other thread that accessing this method is done in this scenario. jvm automatically does that.

please look into wait() and notify()/notifyAll() concepts.

And same thing with other method



I think you should handle this logic in different way. you access this method if you have elements. so before you get here you make sure that one thread is accessing. if elements are not there, then wait() for some other thread fills in some elements in the list.

Thanks,
Ugender
Abayomi,

You are talking about SIP (Session Initiative Protocal from Cisco). Your Java program(using HTTP) can interact with this SIP protocal which actually does all the telephny work. I have very little experience with this. I made HTTP and SIP talking so far but not SIP and an actual telephone yet. But I used IBM WebSphere and BEA's Weblogic's communication platform to make HTTP and SIP communication.

look into edocs.bea.com for communication platform documentation or just google it on SIP.


Thanks,
Ugender
12 years ago