Thank you for visiting the BlackBerry Support Community Forums.
BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)
BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.
"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."
- Kevin Michaluk, Founder, CrackBerry.com
Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.
01-09-2009 01:09 AM - edited 01-09-2009 04:47 AM
I am implementing share trading application using Blackberry.When I place Order for "LIMIT TYPE" the following exception found.."Uncought exception blocking Operation not permitted on event dispatched thread".
What is the Problem?
We are doing network operation by invoke letter.Will it not solve the problem?
Thanks in Advance
01-09-2009 03:38 AM
01-12-2009 06:31 AM
Thanks for reply.
Actually, i am implementing the code given below:-
public void run()
// sending message to the socket Server
I could place the line("socketHandler.getInstance().placeOrder(messa
But i think that it will not solve the problem because the upper given block is called on buttonClick navigation.
So how can i overcome the error
01-12-2009 07:15 AM
invokeLater() does NOT start a new Thread, it jest creates a unit of work that the dispatcher can run later. I believe it will run under control of the main Thread for the Application that invokes it, in this case, the UiApplication main Thread, so you are blocking.
Start a new Thread for network processing. The samples and JDE include code that will show you how to do that.
01-12-2009 08:30 AM
I guess there are two issues:
1) Don't hold a lock while calling code that is not predictable- any IO qualifies. The UI thread effectively holds a lock.
2) Don't lock out user with various modes when you can keep the app responsive and queue up request in the background. Between the time a request is made and a response obtained a lot can happen- including mashing
the keyboard and swearing trying to get the app to respond. I've even gone to global notifications
in some cases- user makes request, then goes check email and can get confirmation popup while in other app.
If you really want, I guess you could grey-out some menu options but a modal lock out rarely makes sense.
01-12-2009 10:26 AM
Thanks for rply, but please tell me that my application already have two threads running. And creating a third thread will cause any proble in speed and memory consumption. And there is only way to get rid of that exception?
01-12-2009 10:48 AM
I wouldn't worry unduly about three Threads. You are allowed up to 16 threads, but given other system requirements, I would recommend not using more than 12. If your application design or system architecture needs the Threads, then use them. But do make sure these are coded in a way that minimizes overhead, in terms of processor and memory, especially watching out for memory leaks. Three well written Threads will have less system impact than one badly designed/coded one.
You probably don't need to have the network Thread running if you are not doing frequent calls - just start and stop it when you need it.
01-12-2009 10:49 AM