Control background threads

Hi guys,.

I'm trying to limit the operation of background threads in BerkeleyDB I 6.0.10.

When I open a database and the environment for writing, apart from my application thread, I see thread a compressor, a cleaner and checkpointer one thread. So for each DB, it's 4-wire.

For 1000 + databases, it is quickly spiral up to 4000 + threads and although it is possible to configure the operating system to answer this, I would like to have control of grain more these internal discussions and run at a time that I'm in control of able to out the load wire.

By reading the documentation, I understand that the checkpointer thread must always run for consistency of db. Fair enough.

My understanding is that the filter thread compact log files I and the thread of compressor is used to cut the B-Tree tree during destruction.

What I don't understand, is that I run many inserts (well, to be honest, they are updated), I get three threads running. I don't understand why I see sons of compressor unless the update is treated as a delete, and insert.

What I really do is stop the vacuum and compressor threads performing automatically and live with the fact that the database is not optimal.

So what I would really like to do is to ask the database "need cleaning/compression?" and if so, then open-> housekeep-> close.

I find this piece of information in the documentation of GSG:

"Note that you can prevent a background running thread if necessary using . I. Properties the parameter, but this is not recommended for production use, and these parameters are not described here. "


The GSG says this on the wire of the compressor:

«There is no need for to manage you the compressor and so he didn't is not described in this manual.»


This means, it may be possible, but we will not tell you how :-)  Is the case - I know that's all at my own risk here! ?


When it comes to the cleaner thread, the GSG indicates that there are some properties I can control, being

je.cleaner.minUtilization


It may be possible to zero to prevent cleaning and then subsequently, increase the value?


So I guess I want to say, even if its not recommended, I would stop one or more of the background threads to run automatically on a db entry. I understand this can lead to bloat the disc and can slow down the query but I'm in the game of reduction instant thread, then return and tidyup at a more convenient time. Is this something that is considered feasible with BerkeleyDB I and if so, what are these properties are not recommended? I would try as this will be my bottleneck rather than the RAM or disk space.


Thank you for taking the time to read my hiking if you get this far, I'm waiting impatiently!


Clive


Hi Clive,.

For 1000 + databases, it is quickly spiral up to 4000 + threads and although it is possible to configure the operating system to answer this, I would like to have control of grain more these internal discussions and run at a time that I'm in control of able to out the load wire.

It is not normally recommended to create environments so I (in BDB, we don't call databases, since a database in BDB looks more like a single table) because the cost per-environment is quite high, and if you write to many environments both on a single disk, you won't get the write performance that I is known for.

However, you are not the first person to create a large number of environments.  It will work, and there is a way to reduce the number of background threads.

But to make sure it's really what you want, I will ask the question: Why create environments so much?  Why not create multiple databases in a single place environment?  Unless you have a very good reason to not, I strongly advise to use a unique environment.

What I don't understand, is that I run many inserts (well, to be honest, they are updated), I get three threads running. I don't understand why I see sons of compressor unless the update is treated as a delete, and insert.

These three threads are created at startup, not on demand.

I find this piece of information in the documentation of GSG:

"Note that you can prevent a background running thread by using the je.properties parameter that is appropriate, but this is not recommended for production use and these parameters are not described here."

The GSG does not cover your use case - of thousands of environments.  You'll need to read the javadoc in detail.
To turn off background threads of I you set the following environment params:
EnvironmentConfig.ENV_RUN_IN_COMPRESSOR, ENV_RUN_CHECKPOINTER, ENV_RUN_CLEANER, ENV_RUN_EVICTOR.
However, your application will not work without checkpoints, compression, cleaning and expulsion.   These are not a few optimizations, they are necessary for any realistic application.
So if you disable background threads of I, you'll need do explicitly these functions yourself, using methods on the Environment class: compress(), checkpoint(), cleanLog() and evictMemory().  These methods are explicitly provided for this purpose.

It will take work to complete these functions yourself properly.  You will need to create your own background threads that call these methods for all of your environments.

In fact, you should not disable the wire out, but instead, you must configure a cache that is shared for all environments using EnvironmentConfig.setSharedCache (true).  When you use a shared cache, it will be expelled one and a single set of background I son expelled (at a minimum, a thread in total).
-mark

Tags: Database

Similar Questions

  • ContextMenu in a background thread

    I can create other controls in a background thread and add them to the UI with Platform.runLater. but when I try to create a component with a contextmenu in the background I get an exception. is there another way to do it?

    You should be able to create the ContextMenu out of the Thread of the JavaFX Application, then add it to a scene on the Thread of the JavaFX Application via Platform.runLater ()... but you can not.

    I logged a question about this precedent (http://javafx-jira.kenai.com/browse/RT-17716). It is not supposed to be addressed in the next version 2.1.
    I don't have one solution other than just to create the ContextMenu on the Thread of the JavaFX Application.

    Comment by Kevin Rushworth on Jira issue:
    "There are two separate, but related, bugs here:

    Creating ToolTip and ContextMenu fail because they create a PopupWindow in their constructor, and a window cannot be created on the FX application thread. One solution would be for delay us the creation of the pop-up window, until the node is added to a scene (perhaps during the initial passage of CSS or layout).

    WebView is a failure because it creates a platform implementation class that must be created on the FX application thread (indirectly through WebEngine). I will file a new issue [RT-17855] for this. »

  • complete execution while the background thread runs

    After the passage of TestStand 4.1 in 2012, I see an interesting problem.

    I start a MainSequence via the SinglePass execution entry point using the parallel model. In ProcessSetup (in the execution of N), I start a background thread that performs certain tasks for viewing. Then the model passes by "Initialize TestSockets" and starts my MainSequence (in year N + 1).

    While the MainSequence is running, run N hangs in ParallelModel.seq > Single Pass, step "Wait for TestSockets", as it should. Usually, when the MainSequence is over, puts an end to execution and execution N goes to the next step "Check to terminate" and some time later, it passes through ProcessCleanup - where I'd send my background thread notification to stop.

    It works as long as I do not start the background thread. But when this thread is running, the execution of N + 1 never leaves the MainSequence. I arrive at a breakpoint at the end of MainSequence, ahead, and then all executions are happily showing a green light and continue to operate on. So running N never leaves "Waiting for TestSockets" and never reaches ProcessCleanup, so my son does not receive the signal of endpoint etc.

    But I distinctly remember that it worked in TestStand 4.1, and anyway, I don't understand this. Why, a background, started in the execution of N, thread prevents the execution of N + 1 to terminate?

    Concerning

    Peter

    "When execution starts a sequence in a new thread (not waiting for the thread to finish at the end of the sequence), should take care at the end of his MainSequence wire in order to put an end to herself in order for execution to terminate?"

    What do you mean by terminate? Process templates are not normally completed executions. Do you mean, "all discussions in an execution must complete before the end of the execution?"? If so, then the answer is Yes.

    I'm not completely your explanations above. I'm not sure what you mean by signs, but I think you're misunderstanding what terminate means in TestStand. Termination occurs only when a user explicitly requests a run to finish (e.g. finish all) or your sequence has an action to complete or by program initiates a terminate. Without endpoint explicit that past, executions normally end when all threads are finished executing. If you are spawning runs and new threads, you must come up with a mechanism to let them know when they have to leave. I do NOT recommend relying on or using termination for this. Termination is as abandoned (but with a cleaning), it is not intended to be something that happens in the normal flow of execution. There are several ways to tell your worker when all discussions. Perhaps this posting you are referring to is a way. You can also use a notification teststand step, or a Boolean value in reference parameter.

    Hope this helps to clear things up,

    -Doug

  • How to check that my application is in the context of the background thread

    I'm listening to push into the background thread, but I want to receive the push only when the application is in the background, and then how to check that the app is in the background

    check if it is listed in http://www.blackberry.com/developers/docs/7.1.0api/net/rim/device/api/system/ApplicationManager.html...

  • push the two overall display of the background thread

    Hello

    I am pushing GLOBAL SCREEN of my background thread using synchronized (Application.getEventLock ()).

    Now, I want to push another SCREEN on this GLOBAL SCREEN.

    But the new SCREEN is not visible on the GLOBAL SCREEN.

    Please help me

    When you push your overall screen make sure that you also provide a priority:

    pushGlobalScreen (aScreen, PRIO_as_INT, UiEngine.GLOBAL_SHOW_LOWER);

    where 0 is the most high prio (always on top)... I use it to mix screens above the other... Screens with the same priirity will display above the other - the last pushed to win...

  • Image of drawing to the screen in the background thread?

    I have image data that comes out of a background thread, and I want to be able to write in a ForeignWindow (or some other window QT I guess... I don't know QT very well). What would be the best way to do this? Is there a good sample somewhere?

    Nevermind, just found the HelloForeignWindow example:

    https://github.com/BlackBerry/Cascades-samples/tree/master/helloforeignwindow

  • Create a background thread to consume a webervice and invalidate Manager to refresh the screen

    Hello

    I create an application that uses Web services to place objects on a VerticalFieldManager with the received information. What I'm trying to do is first tap on the screen and then consuming the Web service on the merits in order to refresh the screen while he receives the info. Right now my app uses the webservice from the preview screen, but it doesn't push the following until he finished consuming the WS.

    I read that you can create a background thread, and then syinchronize with the user interface refresh (invalidate()) screen, but I don't have all the tracks of where to start. Can someone help me please? Including creating a background thread?

    Thank you very much!

    The best way for your background screw to change your user interface within the constraints of the

    UiApplication.getUiApplication().invokeLater(new Runnable()
    {
        public void run()
        {
                     //your UI modifying code here
            }
    });
    
  • Problem chart/getting updated when you press on the background thread notification dialog box

    I have a user who is graphical reports strange behviour after our request and only under the following condiitions alarms:

    1 sets of users clock back to trigger the alarm

    2 user locked the BB

    3. the user receives alarm 1 minute later

    4. the user unlocks the BB

    The strange behavior is that the background seems to resemble a back buffer bland with a rectangular hole where the notification dialog box should be.  The user clicks then the graphics and where the button should be back to normal.

    The question is not if the user does not lock the BB first - it's only under the condition of deadlock that the problem occurs.  The user statement also sometimes see a dialog "Please wait" when running our application after unlocking, but never when our application is stopped.

    Model is 8310 with 4.5 and approximately 3 MB of free space depending on the situation-> filefree.

    The dialog box is to be generated and added to the queue by a background thread using the following method:

        private void notifyUser(String msg) {
            UiEngine ui = Ui.getUiEngine();
            EncodedImage icon = Theme.getIcon(false, true);
            Bitmap bm = null;
            if (icon != null) {
                bm = icon.getBitmap();
            } else {
                bm = Bitmap.getPredefinedBitmap(Bitmap.EXCLAMATION);
            }
            synchronized (Application.getEventLock()) {
                Screen screen = new Dialog(Dialog.D_OK, msg, Dialog.OK, bm, Manager.VERTICAL_SCROLL);
                ui.pushGlobalScreen(screen, 1, UiEngine.GLOBAL_SHOW_LOWER);
            }
        }
    

    I checked the problem does not occur on the "BOLD", Pearl Flip, or 8100 with real hardware.  The problem never happens in simulators (tried about 6 models).

    Any thoughts?  Is there something wrong with the code above or spark a dialogue for a non-event like this thread?

    Thanks in advance...

    The workaround for the "locked" State is to implement MemoryCleanerListener in your main application class. This listener is notified when the device is locked. We define a property here "deviceWasLocked", then query this property of our custom popup dialog to determine if we arrive on a locked screen.

    Then we switch our application in the foreground (requestForeground) that clears up this particular issue, and any event goes well.

    The problem of 'missed calls' is a little more complicated, unfortunately, but you're not complaining that one!

    Having said all this, I'd love to see other ideas on how to solve this problem. We strugggled for several weeks with this problem when the 4.3 is released.

  • Update of the main screen to a background thread

    Hi guys im trying to update the main screen from a background thread. in this case I'm using a 2 static pictures. Once I click on a butotn on the popupScreen when the application is loaded, it will update the image on the main screen.

    I wrote a small excerpt for it and can you please give me some help with this. because when I've debugged and one of the developers helped me thereby to discover that the screen im trying to update is not the active screen.  Please have alook please.ive extract have 3 classes here

    ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

    SerializableAttribute public class MyApp extends UiApplication
    {

    Public Shared Sub main (String [] args)
    {
    Create a new instance of the application and make the currently
    who runs the thread of the application of the event dispatch thread.
    MyApp PAP = new MyApp();
    theApp.enterEventDispatcher ();
    }
        
    /**
    * Creates a new object MyApp
    */
    public MyApp()
    {
    Push a screen onto the stack in the user interface for rendering.
    pushScreen (new MyScreen());
    final Pinpopup pp = new Pinpopup();

    UiApplication.getUiApplication () .invokeLater (new Runnable()
    {
    public void run()
    {
    UiApplication.getUiApplication () .pushModalScreen (pp);
    }
    });
    }
    }
    ////////////////////////////////////////////////////////////////////////////////////////

    / public final class screen extends MyScreen
    {
    /**
    * Creates a new object of MyScreen
    */
    public Bitmap bmp image;
    public BitmapField bmpField;
    public ButtonField btnDisplay;
    public ImageThread imgThread;
            
    public MyScreen()
    {
            
    Set the displayed title of the screen
    setTitle ("MyTitle");
    BMP = Bitmap.getBitmapResource ("image.png");
    btnDisplay = new ButtonField ("Display");
    bmpField = new BitmapField (bmp);

    btnDisplay.setChangeListener (new FieldChangeListener() {}
                
    ' Public Sub fieldChanged (field field, int context) {}
    TODO self-generating method stub
                    
    if(Field == btnDisplay)
    {
    BMP = Bitmap.getBitmapResource ("image1.png");
    bmpField.setBitmap (bmp);
    signInButtonClicked ("07760926037", "1234");
    LaunchImageThread();
                        
    }
    }
    });
            
    Add (bmpField);
    Add (btnDisplay);
            
    }
        
        
    Public Sub LaunchImageThread()
    {
    imgThread = new ImageThread (this);
    System.out.println ("THIS screen:" + this.getScreen ()); I realized that the im screen update is not active but its strange I don't create any other refrence so
    New Thread (imgThread) m:System.NET.HttpListener.start ();
    }
    }
    ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// POPUPSCREEN CLASS
    class Pinpopup extends PopupScreen //implements FieldChangeListener
    {
    private ButtonField btnOk;
        
    Pinpopup()
    {
            
    Super (new HorizontalFieldManager());

    btnOk = new ButtonField ("Sign In");

    btnOk.setChangeListener (new FieldChangeListener() {}

    ' Public Sub fieldChanged (field field, int context)
    {
    TODO self-generating method stub
    Try
    {
    if(Field == btnOK)
    {
    Close();
    MyScreen ms = new MyScreen();
    Mrs. LaunchImageThread();
    }
    } catch (IllegalArgumentException e) {}
    TODO: handle exception
    System.out.println ("Exception Popup all in signingIn" + e.getMessage ());
    }
    }
    });
            
    Manager fieldManagerContext = new Manager (USE_ALL_WIDTH)
    {
    ' public void sublayout (int width, int height) {}

    int xPos = 10;
    int ypos = 40;

    Field = getField (0);
    layoutChild (field, 280, 50);
    setPositionChild (field, xpos ypos + 100 + 165);

    setPosition (300, 300);
    setExtent (350, 225);
    }
    };
            
    fieldManagerContext.add (btnOk);
    Add (fieldManagerContext);
    }
    }

    /////////////////////////////////////////////////////////////////////////////////////////////////////

    / public class ImageThread implements Runnable
    {
    private MyScreen parent;
        
    public ImageThread (MyScreen myScreen)
    {
    parent = myScreen;
    }

    public void run()
    {
    Try
    {
    UiApplication.getUiApplication () .invokeLater (new Runnable() {}
                    
    public void run() {}
    TODO self-generating method stub
    System.out.println ("active screen:" + UiApplication.getUiApplication () .getActiveScreen ());
    System.out.println ("active screen:" + parent.getScreen ());
    parent.bmp = Bitmap.getBitmapResource ("image1.png");
    parent.bmpField.setBitmap (parent.bmp);
                        
    }
    });
    }
    catch (Exception ex)
    {
    System.out.println ("Exception in Thread:" + ex.getMessage ());
    }
    }
    }

    was soon thanks

    I suspect that this is your problem:

    MyScreen ms = new MyScreen();
    Mrs. LaunchImageThread();

    I suspect that if you did as I suggested on the other Thread and put a breakpoint in the constructor of MyScreen, you'd have foiund, this creates a second instance.

    I hope that you can take it from here.

  • The background thread alert does not work

    Hello

    I have read the article http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800332/800505/800608/... and followed the instructions to display the background thread alert. However, the alert is not displayed and IU locks (freezes). Specifically, the event of click/touch does not work, but the background thread continues to run.

    Structure of my program. The main class (with the main function) extends UiApplication. I create in the function main instance of the class that extends the Application. This class starts backgorund wire. I am missing something or making the wrong way?

    Sorry I have expired, I was going to write a long response to this.

    But in short, remember that your automatic boot process and your user interface process, both through main with different parameters and are the BlackBerry is concerned, different applications.  So it may be an Application, the other can be a UiApplication, and both can enterTheDispatcher.

    No two instances of the same Application, they are two different Applications.  They can be of different instances of the same Application class, but it is a special case.  It depends on what you create in the main routine.

    You can play a merry dance with such things.  For example, having a UiApplication be started by the automatic boot process, and then the boot gui process can find it and just put in the foreground, rather than creating a new UiApplication.

    Generally however people create a request and a UiApplication.  The problem with the use of these different applications, is that things like static are not shared.  Therefore, use something like RuntimeStore to share data.  It is a pain and something that if I can avoid.

    It is perfectly possible to have a UiApplication, which starts when the device starts, runs Background Threads that are working in a network and is bought in the foreground by clicking on an icon.  Code is more complicated, but not much.  And you must have complicated the code when you run the network Threads background to deal with the unit off power and then power anyway.

    Hope that clarifies somethings.

  • Multiple instances of Application when you use the background thread

    Hi all

    I recently added a background thread in an application that is launched from an other point of entry. This background thread will constantly (every X seconds) carry out checks of RMS and compares the timestamps. When recalcitrant, he sends a notification to the user who launches the application when clicked. The problem is...

    When the user clicks on the notification, it will open the application normally (with the icon and everything), but it also opens a second instance that does not have an icon. I have concluded that the code that actually launches the request isn't the culprit (because if I take out, it nevertheless opens the second instance). This makes me think that it has something to do with the ApplicationDescriptor.

    My notification Manager has this line:

    ApplicationDescriptor appDescriptor = new ApplicationDescriptor (ApplicationDescriptor.currentApplicationDescriptor (), application name, new String [] {});

    If I change this to only return the currentApplicationDescriptor() or add the arguments in the array of strings, notifications do not work.

    Can anyone think of a reason why this is happening?

    I solved the problem I had.

    In the end, I ended up changing this code:

    final ApplicationDescriptor mainDescription = ApplicationDescriptor.currentApplicationDescriptor ();
    final ApplicationDescriptor appDescriptor = new ApplicationDescriptor (mainDescription, application_name, new String [] {});

    TO:

    moduleHandle int = CodeModuleManager.getModuleHandle (APPLICATION_NAME);
    ApplicationDescriptor mainDescriptor;

    If (moduleHandle! = 0)
    {
    ApplicationDescriptor apDes [] = CodeModuleManager.getApplicationDescriptors (moduleHandle);
    apDes = mainDescriptor [0];

    ApplicationMessageFolderRegistry folderReg = ApplicationMessageFolderRegistry.getInstance ();

    If (folderReg.getApplicationFolder (NotificationManager.INBOX_FOLDER_ID) == null) {}
    notificationManager.init (folderReg, mainDescriptor);
    }
    }

    Instead of using the currentApplicationDescriptor(), I was referencing the module of the application itself using the CoreModuleManager. My init method takes in the ApplicationDescriptor and use it for everything.

    Thanks to all who have any time to read my post!

  • The segmented control background

    I have a segmented control of 3 segments, with fairly long titles in each. Since segmented control does not allow the formatting of the title, I decided to try to work around this deficiency and insert a background image of control (using the DispositionAbsolue with Imageview container for the background and SegmentedControl) containing the titles with a smaller font and let control titles in white. It works, kind of:

    When I do this, the control segmented for some reason any decides to go beyond the width of the container and it clips to the right. Expand the control tabs, and only half of the last tab is displayed.

    If I disable DispositionAbsolue}, all the sizing is correct, except, of course, the background is stacked on the segmented control. Here is my code:

                    Container {
                        layout: AbsoluteLayout {
    
                        }
                        preferredWidth: 568.0
                        maxWidth: 568.0
                        ImageView {
                            imageSource: "asset:///images/SegCtrlBackground.png"
                            preferredWidth: 568.0
                            maxWidth: 568.0
    
                        }
                        SegmentedControl {
                            id: segmented
                            Option {
                                id: option1
                                text: ""
                                value: "1"
                                selected: true
                            }
                            Option {
                                id: option2
                                text: ""
                                value: "2"
                            }
                            Option {
                                id: option3
                                text: ""
                                value: "3"
                            }
                            onSelectedIndexChanged: {
    
                            }
                            preferredWidth: 568.0
                            maxWidth: 568.0
                        }
                    }
    

    I tried to force the width of 568 on a container, as well as two controls that it contains, but not luck. Why is this happening?

    Thank you. I've known for a clean and simple solution that works perfectly: I wrapped the control segmented into its own container on which I forced the width. Here is the code:

                    Container {
                        layout: AbsoluteLayout {
                        }
                        ImageView {
                            imageSource: "asset:///images/SegCtrlBackground.png"
                        }
                        Container {
                            preferredWidth: 568.0
                            SegmentedControl {
                                Option {
                                }
                                Option {
                                }
                                Option {
                                }
                                onSelectedIndexChanged: {
                                }
                            }
                        }
                    }
    

    Here, the SegCtrlBackground.png is 568 pixels wide, containing a rectangle control background slightly more small rounded corners that fits perfectly behind the segmented control. In addition, we could insert a picture of 9-slice and make scalable to different formats, but in this case I didn't need.

  • Background thread which problems refreshing ListField!

    I created a screen that uses a listfield to display the contents of a persistent vector object.

    And now I have an application when the condition is appropriate to remove a vector object. The vector is belong to the lisfield.

    It's my code.

    public class LittleAlarmBackgroundApp extends Application implements
            RealtimeClockListener {
    
        private Vector _alarms;
        private RuntimeStore rs;
        private AlarmListField alf;
    
        public LittleAlarmBackgroundApp() {
    
                     ...                 _alarms = (Vector)_database.getContents();        rs = RuntimeStore.getRuntimeStore();  }
    
      public static void main(String[] args) {
    
                LittleAlarmBackgroundApp bg = new LittleAlarmBackgroundApp();         bg.enterEventDispatcher();
    
        }
    
      public void clockUpdated() {
    
                   ...
    
        if(am.getHour()==hour && am.getMinute() == minute)          {                 if(am.get_type()==1) {    _alarms.removeElementAt(i);//_alarms is a vector that is belong to listfield  alf = (AlarmListField)rs.get(list_key);//alf is a listfield   if(alf != null) {                                  alf.updateList();//this method called setSize() of ListFild                  //AlarmListField(Field).assertHaveEventLock() line: 6067                 //  there is a exception that called IlleaglStateException
    
                      }             }         }     }     am = null;        c = null; }
    
        }}
    

    I want my background thread removes the element of the vector persistent and updating of the size of ListFied so that ListField can update!

    Please help me!

    Instead of

    alf.updateList ();

    follow these steps:

    Application.getApplication (.invokeLater)

    new Runnable() {}

    public void run() {}

    alf.updateList ();

    }

    }

    );

    A slight efficiency would be to declare the executable as a member of LittleAlarmBackgroundApp and then pass the object to invokeLater():

    private AlarmListField alf;

    private Runnable Updater = new Runnable() {}

    public void run() {}

    alf.updateList ();

    }

    }

    - - -

    Application.getApplication () .invokeLater (updater).

  • Send sms from background thread

    Hey I am trying to send sms from a background thread

    I searched the forum and tried a lot of code, but without success.

    anybode help me what m I am doing wrong

    try
    {
    MessageConnection msgConn = (MessageConnection) Connector.open("sms://+"+ "965xxxxxxx");
    TextMessage text = (TextMessage) msgConn.newMessage(MessageConnection.TEXT_MESSAGE);
    text.setPayloadText("helloooooo");
    msgConn.send(text);
    msgConn.close();    
    
            }catch(Exception e)
            {
                System.out.println("exception in sending message:"+e);
            }
    

    I always get illegal argument exception if I get ahead in debug mode.

    If I test on the device then java.lang.error exception is thrown

    I also tried with an address like + 91965xxxxxxx but still the same error

    I also tried with an address like 0965xxxxxxx, but still the same error

    Sometimes it gets hang up

    I have also worked with port don't

    try
    {
      MessageConnection sconn =  (MessageConnection)Connector.open("sms://:3333");
    TextMessage msg = (TextMessage) sconn.newMessage(MessageConnection.TEXT_MESSAGE);
    msg.setAddress("sms://+965xxxxxxx:3333");
    msg.setPayloadText( "Hello World" );
    sconn.send(msg);
    }catch(Exception e)
    {
    }
    

    If anyone can help!

    I got the answer:

    MessageConnection  mc = (MessageConnection) Connector.open("sms://"+address);
    m = (TextMessage) mc.newMessage(MessageConnection.TEXT_MESSAGE);
    m.setPayloadText(msg);
    mc.send(m);
    

    I wrote all the code in a thread separate and calls of my background thread

  • ControlledAccessException while audio playback in the background thread

    I have a system module which is a background thread, who plays one of the ringtones pre-installed on the device. It works great in the Simulator, but on my real device (8320, 4.5.0.81, Tmobile), a ControlledAccessException is thrown and of course, plays the audio.

    The application is signed code, I tried to set all the permissions of the application to 'Allow' and nothing has worked.

    The following code fragment, that's where the exception seems to be happening:

    Player p = javax.microedition.media.Manager.createPlayer("file:///store/samples/ringtones/Alarm_EarlyRiser.mp3);
    p.realize();
    p.prefetch();
    p.start();
    

    I was hoping that among the people of the RIM (or someone else) could point me in the right direction regarding, why this is happening and how to fix this.

    Thank you

    Okay... got official word from [email protected]:

    "It is not possible programmatically to other applications pre-installed media files read, because they are encrypted DRM"

    So that answers that.

Maybe you are looking for