problem with Database.transaction)

Hello

The code contained in the appeal. transaction() in my method. writeDatabase() is not executed. He reached the alert call (dbChecklistInstance.db.version), but nothing else happens. It fails my call alert('1') and it does not generate an exception to the (e) alert call either. I get no error message popping up. Any ideas on where is my bug maybe?

Thank you

dbChecklist = function()
{
    var dbChecklistInstance = {}

    function onDBCreate(dbCreated)
    {
        dbChecklistInstance.db = dbCreated;
    }; // end onDBCreate

    this.readDatabase = function(arrChecklists)
    {
        if (window.openDatabase)
        {
            try
            {
                dbChecklistInstance.db = window.openDatabase('dbChecklist', '1.0', 'Bashbored Tasks database', 1*1024*1024, onDBCreate);
            }
            catch(e)
            {
                alert(e);
            }
        }
        else
        {
            alert('This device does not have HTML5 Database support.');
        } // end if

        try
        {
        dbChecklistInstance.db.readTransaction(function (t)
        {
            t.executeSql('SELECT * FROM dbChecklist.tabChecklists', [], function (t, r)
            {
                alert('b');
                for (var i = 0; i < r.length; i++)
                {
                    arrChecklists.push(r.item(i));
                } // end for
            }, // end function(t, r)
            function(t, e)
            {
                alert(e.message);
            } // end function(t, e);
            ); // end .executeSql
            alert('c');
        }, errorTrans, successTrans); // end .readTransaction
        }
        catch (e)
        {
            alert(e);
        }
    }; // end this.readDatabase

    this.writeDatabase = function(arrChecklists)
    {
        alert(dbChecklistInstance.db.version);

        try
        {
        dbChecklistInstance.db.transaction(function (t)
        {
            alert('1');
            t.executeSql('DROP TABLE IF EXISTS dbChecklist.tabChecklists', [], function(t,r){}, errorTrans);
            alert('2');
            t.executeSql('CREATE TABLE dbChecklist.tabChecklists (sDecription TEXT)', [], function(t,r){}, errorTrans);
            alert('3');
            for (var i = 0; i < arrChecklists.length; i++)
            {
                t.executeSql('INSERT INTO dbChecklist.tabChecklists VALUES (?)', [arrChecklists.sDescription], function(t,r){}, errorTrans);
                alert(i);
            } // end for
        },errorTrans,successTrans); // end .transaction
        }
        catch (e)
        {
            alert(e);
        }
    }; // end this.writeDatabase

    function errorTrans(err)
    {
        alert(err.code + " " + err.message);
    } // end errorTrans

    function successTrans()
    {
        alert("successful transaction");
    }
}

There was a lot wrong with this code. So much worse now.

Tags: BlackBerry Developers

Similar Questions

  • User interface input box appearance problem with database field?

    Hello

    I use jdev11.1.1.7

    I drag a control table data to the user interface page as a form, my problem is the database with no data at this time here my page UI form have no data and also input textbox appearance also don't just do not...

    I need empty text boxes with appearance, but I got only names of attributes only

    can someone help me...

    Thank you..

    It is the expected behavior.

    If you want to see the input controls, you need to have a new or existing line at the British Colombia correspondent

  • Problem with database querying adapter

    Hi all

    The polling option treats all rows from a table at a time rather than use the polling frequency. I used an option to update a field (logical deletion) where I've initialized unread value = ' n "and read the value = 'Y'." Now, the problem is that I have to query a single row in the table for every 60 seconds (the second row should be transformed only after 60 seconds), but all the lines are treated at the same time. Can someone let me know what could be the problem?

    I put in the db adapter options:
    Polling frequency: 60 seconds
    Lines by Document XML and database: 1
    Lines per transaction database: 1
    JDBC, query & Timeout options: 60

    Thank you

    Please see the below URL, this can help you.

    http://www.albinsblog.com/2012/10/DB-adapter-message-throttling-in-Oracle.html#.UQI3_fLDiuk

    Concerning
    Albin I
    [http://www.albinsblog.com/]

  • Problem with rollback transaction with foreign JMS provider

    Hello

    I created a small test to validate this transaction rollback works correctly with a foreign Jms provider (Sonic). My results seem to show that this isn't, but I have my installation is perhaps incorrect so any help appreciated...

    In the example below, I have an MDB that uses the movements of containers managed (Transaction required) and packaging. It receives a message & then sends another message.

    I've explicitly forced a rollback and wait for message received and sent message are ignored. However, on my Sonic queues, I see the number of messages on the output queue (where the message is sent) regularly every restitution time is more tempted, implying the sent message is not be restored.

    This is my EJB code: -.
    @MessageDriven(description = "sample mdb using weblogic resource wrappers", name = "WLPooledSonicJmsTransactionRequiredMessageDrivenBean")
    @TransactionManagement(value = TransactionManagementType.CONTAINER)
    @Resources( {
              @Resource(name = "connectionFactoryReference", mappedName = "localconnFactoryXA", type = javax.jms.ConnectionFactory.class),
              @Resource(name = "sendDestinationRef", mappedName = "local.out.queue1", type = javax.jms.Queue.class) })
    public class WLPooledSonicJmsTransactionRequiredMessageDrivenBean implements
              MessageListener {
    
         private ConnectionFactory sendingConnectionFactory;
    
         private Queue sendDestination;
    
         @Resource
         private MessageDrivenContext mdctx;
    
         @TransactionAttribute(value = TransactionAttributeType.REQUIRED)
         public void onMessage(Message message) {
              System.out
                        .println("on message called on WLPooledSonicJmsTransactionRequiredMessageDrivenBean!!");
    
              Connection jmsConnection = null;
    
              try {
                   String deliveryCount = message
                             .getStringProperty("JMSXDeliveryCount");
                   
                   System.out.println("JMSXDeliveryCount value is: " + deliveryCount);
    
                   if (sendingConnectionFactory == null)
                        System.out.println("sendingConnectionFactory was null!!");
                   sendingConnectionFactory = (ConnectionFactory) mdctx
                             .lookup("connectionFactoryReference");
    
                   if (sendDestination == null)
                        System.out.println("sendDestination was null!!");
                   sendDestination = (javax.jms.Queue) mdctx
                             .lookup("sendDestinationRef");
    
                   jmsConnection = sendingConnectionFactory.createConnection("xxx",
                             "xxx");
                   System.out.println("Sonic version = "
                             + jmsConnection.getMetaData().getProviderVersion());
    
                   Session s = jmsConnection.createSession(false,
                             Session.AUTO_ACKNOWLEDGE);
                   System.out.println("Transaction is: "
                             + weblogic.transaction.TransactionHelper
                                       .getTransactionHelper().getTransaction());
    
    
                   MessageProducer producer = s.createProducer(null);
    
                   Message response = s.createTextMessage("My Reply");
    
                   producer.send(sendDestination, response);
                   System.out
                             .println("message sent from WLPooledSonicJmsTransactionRequiredMessageDrivenBean!");
    
                      // force a rollback for testing purposes
                   mdctx.setRollbackOnly();
    
    
              } catch (JMSException e) {
                   e.printStackTrace();
                   // reset our jndi objects
                   sendDestination = null;
                   sendingConnectionFactory = null;
                   throw new EJBException(e);
              } finally {
    
                   // Return JMS resources to the resource reference pool for later
                   // re-use.
                   // Closing a connection automatically also closes its sessions, etc.
    
                   try {
                        if (jmsConnection != null)
                             jmsConnection.close();
                   } catch (JMSException e) {
                        // reset our jndi objects but no need to tell client
                        sendDestination = null;
                        sendingConnectionFactory = null;
                   }
    
              }
    
         }
    }
    Here are the weblogic-ejb-jar, which defines the destination of reception
    <?xml version="1.0" encoding="UTF-8"?>
    <weblogic-ejb-jar xsi:schemaLocation="http://www.bea.com/ns/weblogic/90 http://www.bea.com/ns/weblogic/90/weblogic-ejb-jar.xsd"
            xmlns="http://www.bea.com/ns/weblogic/90"
            xmlns:j2ee="http://java.sun.com/xml/ns/j2ee"
            xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
            <weblogic-enterprise-bean>
            <ejb-name>WLPooledSonicJmsTransactionRequiredMessageDrivenBean</ejb-name>
            <message-driven-descriptor>
                <pool>
                    <max-beans-in-free-pool>4</max-beans-in-free-pool>
                    <initial-beans-in-free-pool>1</initial-beans-in-free-pool>
                </pool>
                <destination-jndi-name>localmandytest</destination-jndi-name>
                <connection-factory-jndi-name>localconnFactoryXA</connection-factory-jndi-name>
                <jms-polling-interval-seconds>30</jms-polling-interval-seconds>
            </message-driven-descriptor>
        </weblogic-enterprise-bean>
    </weblogic-ejb-jar>
    and it has been part of the weblogic log output (this message is repeated that the container attempts to deliver the message)...
    on message called on WLPooledSonicJmsTransactionRequiredMessageDrivenBean!!
    Session transacted? = false
    message sent from WLPooledSonicJmsTransactionRequiredMessageDrivenBean!
    <07-Oct-2010 13:09:45 o'clock BST> <Info> <EJB> <BEA-010213> <Message-Driven EJB: WLPooledSonicJmsTransactionRequiredMessageDrivenBean's transaction was rolled back. The transaction details are: 
    ......
    Published by: MandyWarren on October 7, 2010 07:05 added weblogic-ejb-jar. XML

    Published by: MandyWarren on October 14, 2010 14:53 in order to take account of the last changes of the code

    Published by: MandyWarren on October 14, 2010 15:30 - code removed for only if rollback count == 1 because it does not work

    Published by: MandyWarren on October 21, 2010 22:36 deleted info specific environment

    Just a quick update...

    I raised this issue to the support of Oracle who confirmed that it was a bug see their response below...

    >
    I just got an update of JMS engineering.

    They Bug 81388508142162 is the best candidate: 8138850 is for WLS 9.2.x, while 8142162 is for WLS 10.0.x.
    The fix is included in 9.2.3 WLS and WLS 10.0.2
    >

    I upgraded to 10.0 MP2 as no new patches are now provided for 10.0 MP1 and the problem was solved.

    A big thank you to everyone for their help on this.

  • Problem with database adapter serivce

    Hello

    I'm working on a project where we have a service of routing and database adapter service. The interface worked great until we have included the parmameters (attributeFormDefault = "unqualified" elementFormDefault = "qualified") in routing service xsd. After we have updated the service of routing with these settings, it has stopped working, the BSE is simply greyed out without raising any error message.
    I tried all possible ways (recreated the services / removed from BSE and registered them again) but nothing seems to work.

    Any suggestion?

    Thank you
    Anil

    JDeveloper with SOA included 10.1.3.1.0 elementFormDefault = "unqualified" in the generated XSD. This has been changed to 10.1.3.3.0 to "qualified" so if you have a 10.1.3.1 JDev and you use SOA 10.1.3.3 (or 10.1.3.4) you will encounter problems (usually of namespace issues) because the two are incompatible. The solution is to synchronize your JDev and SOA with the same version. You can mix with 10.1.3.4 10.1.3.3, but you cannot use 10.1.3.1 with both versions.

  • Problem with database SQLite 20 MB

    Hello

    I m developing an application with SQLite and I need to attach a large database, 20 MB. I have can´t generate the relase, I get the following error.

    Take a look:

    http://supportforums.BlackBerry.com/T5/Java-development/download-large-files-using-the-BlackBerry-mo...

    I downloaded a database of 250Mb in this way (of course 50 MB zipped)

  • VCenter 2.5 Update 1 updated 5 problems with database vim_vcdb

    Hello

    I've recently updated the vcenter 2.5 Update 1 to day 5.  Everything was fine, no problem, but now I have windows event log error messages complaining of the log for the database "VIM_VCDB" is full. To find out why space in the log cannot be reused, see the log_reuse_wait_desc column in sys.databases

    The VIM_VCDB database is set to simple recovery mode.

    My environment is 6 esx servers and 30 virtual machines.  VCenter is led on a physical server using sql express 2005 for the database.

    VIM_VCDB.mdf file size is 640 MB and VIM_VCDB.ldf is 688 MB

    I dropped the log file and it reduces to 1 024 k but after about 30 minutes, he pushes to 688 MB size and I get the error again.

    Any ideas?

    Could you please try to increase the limit more?

    Thank you.

  • Problem with CallCreate Transaction API and VB :)

    When I try to create an application like Gytis teach me, I get this error

    Failed to create. Detail: Field lTemplateRef has no specified value.
    -1

    I think that this templateRef is not mandatory data, also if I put

    "wsWorkFlowreq.lTemplateRef =" ~ 0 ' ' or -1000 or what "

    I get another error, any idea guys?

    Kind regards

    V9

    Based on the next line, it looks like you are trying to create a workflow:

    wsWorkFlowres = wsCall.WorkflowCreate (wsWorkFlowreq)

    According to Chapter 23: Transactions Workflow (request) of the manual of use of the API, the lTemplateRef value is required.

    If you dishes trying to create a call and not a demand, then above the line should probably be something like:

    wsWorkFlowres = wsCall.CallCreate (wsWorkFlowreq)

    See Chapter 8: Transactions call for more information on what values are and are not necessary.

  • Problem with database/database Oracle Tuning

    Finally manged to get dbms_workload_replay working, now I have another problem, when I run this command

    declare l_report clob;
    Start
    dbms_workload_replay.compare_period_report (replay_id = > 11,
    replay_id2 = > null,
    format = > dbms_workload_replay.type_html,
    result = > l_report);
    end;

    I get the error
    ERROR at line 3:
    ORA-06550: line 3, column 3:
    PLS-00306: wrong number or types of arguments in the call to
    + 'COMPARE_PERIOD_REPORT ' +.
    ORA-06550: line 3, column 3:
    PL/SQL: Statement ignored

    Any ideas?

    Your first parameter must be named replay_id1 not replay_id.

    I hope this helps!

    As always check the documentation: Procédure COMPARE_PERIOD_REPORT

  • Problem with database sql and TS 3.0


    Hello

    the solution is to use: select TOP 0 *... then the table will be loaded vacuum.

    schwede greetings

  • Problem with the password Bank on Portege M700-116

    I have problem with database password on my laptop with win Vista Business SP1 OS.
    When I start windows and open the Mozilla Firefox web browser after a few seconds pwdbank.exe does not work and is disabled.

    Can you help me please?

    Hello

    Just a question: is the message of Firefox or something else. I installed Firefox on M700 friends and there is no message. I didn't test it extensively, but the message is not is not displayed.

  • Problem with creating, truncating and deleting a database in 1 transaction

    Hello

    I came across a problem when it is in the same transaction creating a data base, truncating it and then delete it. Do these 3 things causes the following transaction validation to last forever.
    The following code causes the problem:

    File envHome = new File ("truncate-delete-test");
    envHome.mkdirs ();
    EnvironmentConfig envConfig = EnvironmentConfig.DEFAULT;
    envConfig.setAllowCreate (true);
    envConfig.setTransactional (true);
    envConfig.setTxnSerializableIsolation (true);
    Environment = environment (this.envHome, envConfig);

    Transaction txn = this.environment.beginTransaction (null, TransactionConfig.DEFAULT);

    DbConfig DatabaseConfig = new DatabaseConfig();
    dbConfig.setAllowCreate (true);
    dbConfig.setTransactional (true);
    String dbName = "test-db";
    Database db = this.environment.openDatabase (txn, dbName, dbConfig);

    CBI Close();
    environment.truncateDatabase (txn, dbName, false);
    DB = this.environment.openDatabase (txn, dbName, dbConfig);

    CBI Close();
    this.environment.removeDatabase (txn, dbName);

    TXN.Commit (); <-this statement would never return.

    I encountered this problem with version 4.0.92. I've updated to 4.1.7 but the problem still exists.
    Also, it manifests when the records are written to the database before and after it truncate.

    Looking in the process with the debugger shows the following stack trace during the commit endless happens:

    [...]
    DbTree.deleteMapLN (DatabaseId) line: 1069
    DatabaseImpl.finishDeleteProcessing (line): 1164
    Txn.cleanupDatabaseImpls (boolean) line: 1404
    TXN.Commit (durability) line: 728
    TXN.Commit (line): 549
    Transaction.Commit (line): 227
    [...]

    Depending on where I stop the process, there are additional calls on top of the stack.

    Exit Registration unfortunately does not help here, as the log messages stopped once the problem started to appear.

    Is it somehow not allowed to create, truncate and delete a database in the same transaction? I couldn't find anything in this sense in the documentation, and it is no exception either.
    Or have I came across a bug in I here?

    Thanks in advance for any advice or solutions.

    Christoph
  • problem with recording new object database

    Hi all

    I am having some problems with registration of the database object.

    I have 2 classes

    {Test}
    Laboratory Lab - > not nullable in DB
    LastElement-> element (2 part)
    Items in collection-> (a-2-many element)
    }

    Element
    {
    String value
    Test parentTest-> (one to a test - key to building elements)
    }

    1. I create new Test ts1 and new element el1
    2. I add el1 ts1 items
    3. I updated el1 lastElement in ts1
    4 assignSequenceNumbers
    When I will I have an exception for the Insert for Test-> impossible to insert null for LAB_ID

    I found that if I do step 3 everything works fine and the INSERTION is done in a single step (all the attributes private and one-2-one References are included)
    If I do the step 3, only private attributes are generated for the insert and after insertion will update for all individual references. And it would be ok if I wouldn't not nullable fields.

    Is it possible to force Toplink do not separate first INSERTION to 2 calls?

    Any suggestions will be greatly appreciated.

    PS. all objects are correctly saved in UnitOfWork

    Thank you

    First of all you have parentTest in el1? You must take care of both sides of the relationship.
    Secondly, if you did and which does not help, maybe you can change a constraint not null on defered lab so he would be checked at the end of the transaction not to each insertion.

    Published by: sebastian.kolski on October 8, 2009 10:27

    Published by: sebastian.kolski on October 8, 2009 10:28

  • Strange problems with the database

    Hello

    I just got my Fuze and am very happy with it; However, I am having a very strange problem with the database. I have a 16 GB sdhc card that I use with the "rocket" and there are about 4 songs on the card that will not play and have no information charge tag. Their tags appear in the tag browser (not the in the track information screen) as just an empty rectangle. Under the track information screen, sizes are listed as ~ 4000 mb. The songs will not play and I can not jump in front of one of these songs once they were loaded.

    At first, I suspected some kind of corruption of tag, so I set out that night to track down the problem. I removed the 16 GB card and reset the player. Then, I loaded one of the corrupt in the internal memory of the player. The track has been scanned and played correctly. Then, I removed the track of the internal memory and it loaded on another SDHC card. Yet once, everything worked correctly, so I knew that the card I was using was a kind of system files or physical problem. I returned the original 16 GB sdhc card in the reader and checked that the file was still unplayable, and then I plugged the "rocket" to my computer. I transferred the unplayable file on my computer and compared (with md5sum) to the original file, thinking that if there was the file system or physical corruption the copy of the map would be damaged. However, the files were equivalent.

    To make things even more interesting, I also have problems with the registration of the kind. I have some files tagged Genres such as 'Classic' and 'Rock '. In the list of the genre, I see this:

    C

    CL

    CLA

    CLAS

    Class

    Classic

    Classic

    Classica

    Classic

    Rock

    So, there is corruption on the kind of 'Classic' but not the kind of "Rock". Each of the substrings of 'Classic' contains only a few titles, with most of the other titles listed where they should be. I checked that the tracks are labeled correctly and in exactly the same way as the other tracks that do not have this problem.

    I am at a total loss about what to do, and I'd really appreciate any advice or suggestions. I use the current firmware, 2.03.31a and the songs in question are in Ogg Vorbis format.

    MM

    Thanks for your replies.

    I managed to find what may be the problem. Tracks that received corrupt tags had the names of total path with more than 256 characters. It seems that the driver internal fat32 the rocket uses vomits all over the place when the path name is too long. Before the "rocket", I got an iPod running rockbox tags with the same directory structure that I have on the "rocket", so I don't think that this restriction on the length of the path name is a limitation or requirement of the fat32 file system. Reduce the path corrected the problem with the files being unreadable.

    However, the problem with foires genres the rest. Looking at the files show that corruption, they all have a little information in tags. Most of the information is contained in the hashes I have files that identify them via musicbrainz. The limit on the total number of characters in the tags of the track includes the "rocket" label is not read or use?

    MM

  • Problem with BBUI / Web database / asychronous timing: untreated by BBUI.js query in HTML format

    I think I solved most of my problems with getting my data to be used in various functions, etc... but the problem now (which may have been the problem basic all along) is related to the asynchronous nature of the treatment of Web database.

    I get my markup returned as a

    with all the 'data-bb-type' attributes etc, but based on the statements of 'alert' I sprinkled throughout my code, database results are processed after the 'onscreenready' event is over and "ondomready" began.

    I know that if you generate markup for use with BBUI.js, he must enter the screen "" before the screen "" is passed to BBUI.js BBUI can do everything it's the stuff of fantasy for her.

    I tried to make sense, but it escapes me. Maybe someone could point me in the right direction for a good tutorial that explains clearly what is happening behind the scenes, and then I guess I'll have to rip my code share and put back... or at least call functions in a different way or from a different location or use the callbacks more liberally (I'm not exactly clear on the use of reminders either).

    The approach you describe would be necessary in the sense that an asynchronous call in the onscreenready function will allow this function to progress / probably finish and BBUI continue on treatment until you can completely change the elements with the data returned by the database.

    Content, while not ideal, front-loading is a valid route.

    The other option, depending on which time of control you're filling, would wait for ondomready and then use the JavaScript APIs for the control (if any) to be completed after the fact. For example, the ImageList controls have JavaScript APIs to refresh their content with an array of elements, once the element has been created / BBUI-means.

Maybe you are looking for

  • A30 and Intel 2200BG working now with Scotch!

    I searched and read and did not believe what I read, but with the help of a little Scotch tape on terminals 11 and 13, I'm running.3 weeks I have fought this, support Intel only responded once to tell me to download the latest version of SW, which I

  • L220x random black screen

    Hello! I have a serious problem with my L220x new and this forum is kind of my last idea to look for a solution. Maybe someone can help... Apparently randomly, I meet the following (from the office, the video games, full screen)... 1 several times pe

  • First time Setup wireless connection... big time help needed!

    I just hooked up internet cable and went to connect my wireless switch. It's a Linksys EZXS88w ver 3.1. He is old enough - I could not find any firmware for it on Linksys website. Anyway, I hooked and found my connection - it is only about 11.0mpbs i

  • I need a complete recovery with XP home disc

    How can I do to affect all records needed to get my HP Pavilion a409.uk up and running again.  A family friend gave my son their old HP less hard drive. We bought a new hard drive, but now have the installation discs to get it running. The original d

  • Cannot access Twitter using applications from Surfact RT

    I had a few third-party apps for twitter, which worked fine until a month ago.  Now, none of them can connect to Twitter.  I get messages like can not connect to the services, or cannot connect at this time, try again later, etc. Details: I have many