Adobe Air SQLite Concurrency/Best Practices

Hello Everyone,
  I posted this on Stackoverflow, but I was wondering if there were any I guess design patterns or hints concerning the usage of a SQLite DB.  I'm asking this mostly because with the Adobe Air sqlite implementation, you can't modify the timeout, so you have to re-architect your application to try and retry your sql statements.
I am attempting to use a SQLite DB with an AIR project and there seem to be a few questions that I just can't seem to find the answers to on the internet, especially ones concerning best practices.
The first is about having multiple connections in the same application instance.  Some application processes require the use of a db for a split second, and would better be served by a synchronous type code flow (try{}catch(){}).  Some processes may take awhile and would be better served by an asynchronous code flow with an AsyncResponder.  Because of this, I have thought about having a ConnectionPoolManager which would have multiple instances of async and one instance of my sync SQLConnection classes.  Is this a decent, good or absolutely atrocious idea ?  This leads me to my next point.
Is there any issue of having multiple async connections running their async statements in parallel ?  I've seen some people complain about the db being locked, and I've read that only one statement can perform a write at a time.   What happens if a write statement gets called to execute(new Async...) while another one is busy ?  Will an error be thrown, or will it wait for a timeout ?
Any clarification about this issue would be greatly appreciated.  I keep running into sources that kind of answer one-off questions but not my question in particular.  Usually I would go test it myself, but I'm worried I may not be able to reproduce the pitfall error that will only manifest itself at heavier usage levels.

I'd suggest checking out the following links for tips and
source code for best practices on SQLite:
http://www.adobe.com/devnet/air/flex/articles/air_sql_operations.html
http://www.peterelst.com/blog/2008/04/07/introduction-to-sqlite-in-adobe-air/
- Rob

Similar Messages

  • Creating a SDK (.swc) in Adobe Flash CS5 - Error + Best Practices Questions

    Hello all,
    I'm currently developing a client library for a server-based API which is developed by my company.
    The goal is for the .swc to be usable in both Flash and Flash Builder (any Actionscript environment, really).  So far I've just been creating it in Flash CS5 and have yet to test it in Flash Builder.  It contains a single piece of UI (a login window) but is intended to expose a number of actionscript classes as API interface points to the developer.  The login window is a single Movie Clip placed onto the stage.  I have been testing by simply running the Flash project for the SDK and it works well.
    However, I run into problems when I attempt to use the SWC in other projects (I have the Flash project for the SDK set to create a SWC as well as a SWF)...
    I link the SWC to the other project using the flash compiler settings
    com.mycompany.SDK is a class required for initialization (singleton) and com.mycompany.LoginWindow is the UI window for logging in
    The developer needs to call SDK.Initialize(), which seems to work fine
    When the following code is added I get the below error: addChild(new LoginWindow())
    1046: Type was not found or was not a compile-time constant: InstanceInfo.
    I take it that the error is a result of an undefined class - but I cannot figure out where InstanceInfo (it is not a class of mine) is being used or how to fix this...

    Found a good example that helped me figure this out.
    http://www.adobe.com/devnet/air/flex/quickstart/articles/xml_prefs.html
    Will share the results when complete.
    Thanks

  • Flash Alternative Content ~ Best Practice ~ Safari on iOS Devices ~ iPad iPhone iPod Touch

    Hi Folks,
    Is there a documented best practice for providing alternate content for Flash in Safari on iOS devices?
    I am getting white space where my Flash animation would normally appear, and management is displeased. I need to display alternative content in this space. I'm hopeful that Adobe has published a best practice for how to accomplish this.
    tyvm
    Keith

    Not sure about Adobe official stance but they have started using swfobject Flash detection to place Flash <objects> on the Web page. The problem I see with the Adobe implementation is that about the only alternate content they recommend is "Click here to download the latest version of Flash player".
    That is about the lamest alternate content you could possibly imagine! Just because you recommend that your viewers download the new version.... doesn't mean they will... so they still go without REAL alternate content.
    A MUCH BETTER use of swfobject is to actually provide alternate content! For your review::
    If you think that Flash is somehow bad for SEO, it's time to dispell that MYTH!
    If fact, in some circumstances I'll use Flash INSTEAD of just HTML because then I'll have better SEO than with just HTML alone.
    http://www.worldbarefootcenter.com/
    The link to World Barefoot Center in the above post is just one example. View the source code and you see a couple paragraphs of text along with regular HTML links.... but what displays is the Flash version of the image and Flash links.
    The client provided the artwork for the page... and that's what they wanted to use a .jpg image. Well yes, that could be done in HTML but it would be virtually invisible to Google. So Instead I converted the image into a Flash .swf and used swfobject to display the Flash. swfobject allows you to create alternate content inside the <div> which also holds the Flash .swf, then when the page is loaded it detects if the browser has the Flash pluggin. If it does, it displays just the Flash content, if not, it displays the alternate content. Since almost everyone has the Flash pluggin, for most people the Flash version of the <div> will display.
    The alternate content for that <div> can be any regular HTML text, images, media player, links, etc., anything that you would use if you were not using the Flash. Now the best part is that the alternate content can be "over the top" as far as optimizing for SEO, since it will not be seen by most viewers.
    Here's another example of SEO with Flash.. again, the page is just a single image provided by the client:
    http://www.ksowetsuits.com/
    View the source code. The alt content is paragraph after paragraph of information about the site, including lists and links. If it was just the HTML, it might be kind of a boring Home page. But for SEO I can go "over the top" in promoting the site, since most viewers will never see that part... but it's all indexed by search engines. The end result is BETTER SEO using Flash than just HTML.
    On another Web site, a Flash video is displayed, the alt content is the complete text narration of the video. Now how many people would take the time to read that if they could just watch the video instead?? again, better SEO with Flash than without. In fact in one case we had first page search result from that video narration within 4 hours of posting the page.
    On still another site with a Flash video, the alt content is another video, but a .mov version, which will, in effect play Flash video on the iPhone (not possible you say??). Well since the iPhone does not have Flash pluggin, it simply displays the .mov version of the video, while everyione else sees the Flash version.
    So anyway, if Flash is a part of your Web development, you should look into using swfobject and alternate content.
    http://code.google.com/p/swfobject/
    Best wishes,
    Eye for Video
    www.cidigitalmedia.com
    So it is and has been for a number of years now, very easy to provide alternate content for non Flash devices... and that includes text, images, and video.
    Best wishes,
    Adninjastrator

  • Any Best Practices for developing custom ABAP reports for Portal?

    Hello,
    The developers on our project are debating the best way to develop custom reports and make them available on the portal.  Of these options that we can think of, can you give any pros & cons, or experiences, or other options?
    - Web-enabled Abap report programs
    - WebDynpro for Abap
    - WebDynpro for Abap using ALV
    - Adobe forms
    Does a "Best Practices" document or blog exist on this topic?
    Thanks,
    Colleen

    Re: Using p_trace=YES

  • Best practice on sqlite for games?

    Hi Everyone, I'm new to building games/apps, so I apologize if this question is redundant...
    I am developing a couple games for Android/iOS, and was initially using a regular (un-encrypted) sqlite database. I need to populate the database with a lot of info for the games, such as levels, store items, etc. Originally, I was creating the database with SQL Manager (Firefox) and then when I install a game on a device, it would copy that pre-populated database to the device. However, if someone was able to access that app's database, they could feasibly add unlimited coins to their account, unlock every level, etc.
    So I have a few questions:
    First, can someone access that data in an APK/IPA app once downloaded from the app store, or is the method I've been using above secure and good practice?
    Second, is the best solution to go with an encrypted database? I know Adobe Air has the built-in support for that, and I have the perfect article on how to create it (Ten tips for building better Adobe AIR applications | Adobe Developer Connection) but I would like the expert community opinion on this.
    Now, if the answer is to go with encrypted, that's great - but, in doing so, is it possible to still use the copy function at the beginning or do I need to include all of the script to create the database tables and then populate them with everything? That will be quite a bit of script to handle the initial setup, and if the user was to abandon the app halfway through that population, it might mess things up.
    Any thoughts / best practice / recommendations are very appreciated. Thank you!

    I'll just post my own reply to this.
    What I ended up doing, was creating the script that self-creates the database and then populates the tables (as unencrypted... the encryption portion is commented out until store publishing). It's a tremendous amount of code, completely repetitive with the exception of the values I'm entering, but you can't do an insert loop or multi-line insert statement in AIR's SQLite so the best move is to create everything line by line.
    This creates the database, and since it's not encrypted, it can be tested using Firefox's SQLite manager or some other database program. Once you're ready for deployment to the app stores, you simply modify the above set to use encryption instead of the unencrypted method used for testing.
    So far this has worked best for me. If anyone needs some example code, let me know and I can post it.

  • SQLite Best Practices

    When I work with web-based SQL, I typically close connections
    as soon as I'm done because of the stateless nature of HTML. I'm
    wondering if that's really necessary when doing SQLite from an AIR
    app. Is there a good URL for best and most efficient practices with
    AIR and SQLite?

    I'd suggest checking out the following links for tips and
    source code for best practices on SQLite:
    http://www.adobe.com/devnet/air/flex/articles/air_sql_operations.html
    http://www.peterelst.com/blog/2008/04/07/introduction-to-sqlite-in-adobe-air/
    - Rob

  • ColdFusion AIR Synchronization - Best practices

    I'm a long time ColdFusion developer who has put off learning Flex because I never had a need (not to mention the bad taste Flash left in my mouth in its early stages).  Now I'm jumping in because of its integration with Air+SQLite and Coldfusion9 that allows online/offline support.
    Really cool stuff, but to my knowledge there are only two blogs that have a post about how to do this synchronization (Jayesh's blog and Terrance's blog), both of which use the same sample application.  So I'm hoping there are experts on this subject (which is not entirely CF+Air sync related), can shed some light for me.
    My questions are from a best practice standpoint, primarily: where should all of this code go?  Let me be a little more specific (and I appologize in advance for my misuse of termonology, and my overall ignorance of OO ):
    In the example code there are two tables (AS classes): Address.as and Customer.as.  The contents of these files and the ORM concepts in general I understand.  However, the files are lodged in a folder called "onetoone" in the main "src" directory.  In a best practice scenario, should these be in a "model.vo" directory (assuming no other frameworks are being used)
    Also in the example code, all of the AS code that handles connecting to the back end, fetching, saving to SQLite and back to the server is in the main application mxml file "CFAIROfflineCustomerManagerApp.mxml".  I'm not a Flex developer yet, but I don't think this is good.  I guess it's fine for a simple 2 table scenario, but in real life this will become a huge beast.  How would this best be broken up into separate files?  I'm relatively new to OO, I get the concepts but haven't used it in a pure form in any production applications.  My initial inclination is to separate the code that deals with the CF back-end and the SQLite database into a "services" directory and all the code that pulls that data into the UI (and stuffs it back) into a "controllers" directory.
    Perhaps one of the many frameworks out there may clear things up for me?  I have been reluctant to use a framework at this point because I would like to understand better what they solve before choosing a framework.  Are there any examples of this new sync feature via cfair.swc in any of the popular frameworks?  I've searched, but turned up nothing.
    I think this is enough for now.  I like to keep my code really organized, and before I get too far into writing bad code in an unorganized way - I thought I'd ask for some guidance.  At least this way I can write bad code in an organized way!
    Thanks in advance for any advice, resources, etc...
    --Abram

    I'm a long time ColdFusion developer who has put off learning Flex because I never had a need (not to mention the bad taste Flash left in my mouth in its early stages).  Now I'm jumping in because of its integration with Air+SQLite and Coldfusion9 that allows online/offline support.
    Really cool stuff, but to my knowledge there are only two blogs that have a post about how to do this synchronization (Jayesh's blog and Terrance's blog), both of which use the same sample application.  So I'm hoping there are experts on this subject (which is not entirely CF+Air sync related), can shed some light for me.
    My questions are from a best practice standpoint, primarily: where should all of this code go?  Let me be a little more specific (and I appologize in advance for my misuse of termonology, and my overall ignorance of OO ):
    In the example code there are two tables (AS classes): Address.as and Customer.as.  The contents of these files and the ORM concepts in general I understand.  However, the files are lodged in a folder called "onetoone" in the main "src" directory.  In a best practice scenario, should these be in a "model.vo" directory (assuming no other frameworks are being used)
    Also in the example code, all of the AS code that handles connecting to the back end, fetching, saving to SQLite and back to the server is in the main application mxml file "CFAIROfflineCustomerManagerApp.mxml".  I'm not a Flex developer yet, but I don't think this is good.  I guess it's fine for a simple 2 table scenario, but in real life this will become a huge beast.  How would this best be broken up into separate files?  I'm relatively new to OO, I get the concepts but haven't used it in a pure form in any production applications.  My initial inclination is to separate the code that deals with the CF back-end and the SQLite database into a "services" directory and all the code that pulls that data into the UI (and stuffs it back) into a "controllers" directory.
    Perhaps one of the many frameworks out there may clear things up for me?  I have been reluctant to use a framework at this point because I would like to understand better what they solve before choosing a framework.  Are there any examples of this new sync feature via cfair.swc in any of the popular frameworks?  I've searched, but turned up nothing.
    I think this is enough for now.  I like to keep my code really organized, and before I get too far into writing bad code in an unorganized way - I thought I'd ask for some guidance.  At least this way I can write bad code in an organized way!
    Thanks in advance for any advice, resources, etc...
    --Abram

  • Adobe "Best Practices" aren't practical to implement!

    Maybe I'm just venting, but seriously -- what the heck guys
    (Adobe)?
    I've been pretty forgiving in general about this kind of
    stuff but the list of annoying issues I've been finding is getting
    a little long. It seems like every time I make a serious effort to
    implement Adobe's "best practices" form validation functionality,
    it takes a massive amount of time unless you're doing it EXACTLY
    like the example presented here:
    http://www.adobe.com/devnet/flex/quickstart/validating_data/#section3
    And even here, there's *alot* of repetitive (and
    bug-vulnerable) code going on here if you're doing multiple forms,
    or forms of any modest level complexity. God help you if you're
    trying to use these "best practices" using an editable DataGrid
    with validation assistance in a popup window...
    Is this an outdated article or something? Are there any
    useful examples of how to do this more effectively (maybe with some
    code reuse?), that include less commonly (but still important)
    features required for accessibilty (disabling buttons seems to
    screw with tab navigation) or various types of custom
    functionality?
    I know this is like complaining that the air conditioning in
    my private jet is hard to control, but if Adobe's gonna recommend
    doing this, it shouldn't take hours to do, right?

    This may be a good starting to to work on a better solution.
    Seems to take care of the problem of repetitive code at least.
    http://blog.wheelerstreet.com/?p=123
    Hopefully someone from Adobe will address these issues, and
    improve on their documentation and examples. I find myself going
    through the Flex SDK source code sometimes trying to figure out why
    something doesn't work (DataGrid stuff in particular) or how to get
    a certain behavior.

  • Best practice to deploy some secret credentials in AIR app

    Hi,
    Can someone suggest the best practice way to deploy some
    secret credentials in an AIR app please?
    For example, network connection settings or passwords ?
    In my particular case (and since this is only for testing)
    I'd like to deploy a password in an AIR app. So is there any way to
    effectively deploy an encrypted store with the app ? (hope that
    makes sense!)
    Tks,
    Alex

    I think the best practice is not to do it. You can't deploy
    an encrypted local
    store file to another computer. You could encrypt the
    information some other
    way, but that just moves the problem. If you have a server,
    you could have the
    app connect to the server to get the sensitive information
    and put it into the
    ELS (ideally through HTTPS).

  • SQLite encrypted Database does not get attached Using Adobe Air,Why?

    Hi,
    Any one knows the solution, am trying to attach the encrypted SQLite database adobe air-adobe flex bulder , it does not get attached using sqlconnection.attach throws error, though the given key is correct, but it gets open using sqlconnection.open with the same key, any one knows the solution, how to attach the encrypted data base, since am using two data base one is opened and another must be attached to the existing ,thanks in advance. using adobe air- flex related. i use the following code
                   databaseFile1 = File.applicationStorageDirectory.resolvePath("Sample_1.sqlite");
                   databaseFile2 = File.applicationStorageDirectory.resolvePath("Sample_2.sqlite");
    dbConnection.open(databaseFile1, SQLMode.CREATE, false, 1024, secKey);
    dbConnection.attach("db2",databaseFile2,null,secKey);
    got the following error.
    ERROR #3125 Unable to open the database file.

    And I would say more "this is the issue" !
    It should be possible as it is clearly stated in the doc :
    public function attach(name:String, reference:Object = null, responder:Responder = null, encryptionKey:ByteArray = null):void
    with 
    encryptionKey:ByteArray (default = null) — The encryption key for the database file. If the attach() call creates a database, the database is encrypted and the specified key is used as the encryption key for the database. If the call attaches an existing encrypted database, the value must match the database's encryption key or an error occurs. If the database being attached is not encrypted, or to create an unencrypted database, the value must be null (the default).
    so with a same encryptionkey, I (and this should be the same for FinalTarget) can open the encrypted db but not to attach it... quite strange.

  • Naming a customisation by extension concurrent program - best practice

    Hi,
    I am developing a customisation by extension of the seeded concurrent program ‘Open Purchase Orders Report(by Cost Center)’ and need to decide on a name for my custom program in the Concurrent Programs (FNDCPMCP) form.
    I would like to know if there is documented best practice for naming my custom program i.e. should I name my custom program with a prefix to differentiate it from the seeded version e.g. ‘ABCD Open Purchase Orders Report(by Cost Center)’.
    Thanks in advance.
    Mark

    Hi,
    have a look at Oracle Application Developer's Guide. There's a chapter (named "Defining your custom application")
    with recommendations regarding defining custom applications:
    http://docs.oracle.com/cd/B34956_01/current/html/docset.html
    In fact you should start with defining a custom application in System Administrator (according to Oracle's recommendation
    it shouldn't be more than 4 characters, starting with "XX" to avoid conflicts with Oracle's own application short names).
    After that you can register your custom reports/forms/concurrents with the newly created application.
    Regards

  • How to save the date in Sqlite in Adobe Air application

    hi friends,
    i am doing a flex Adobe AIR Application with SQLITE Data base,in that i want to save Date in the following format DD/MM/YYYY, but in my TABLE i gave the data type is DATE,
    So it store the value like this Sun Dec 2 00:00:00 GMT+0530 2012.i want to store the value in DD/MM/YYYY.How to do that?
    looking for useful suggession.
    Cheers,
    B.venkatesan.

    Hi, maybe cannot help much on this since I have not much experiense on handling SQLITE in AIR.
    But I know there are a command/example for reading SQL:
    http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/data/SQLConnectio n.html
    http://help.adobe.com/en_US/as3/dev/WS5b3ccc516d4fbf351e63e3d118666ade46-7d49.html
    And in mxml you should have an id for each individual TextInput component, also have a button:
    <Button click="updateSQLHandler(event)"/>
    When the button is click the handler function is launched.
    The updateSQLHandler(event:MouseEvent) is a script that read the each individual TextInput component by getting (id of textinput component).text.
    Then, you create a String varible that is an SQL commands with the texts in the form, and update the SQL database following the below using the execute() command (refer to http://help.adobe.com/en_US/as3/dev/WS5b3ccc516d4fbf351e63e3d118666ade46-7d49.html ).
    Hope this help.

  • Best Practices for Creating eLearning Content With Adobe

    As agencies are faced with limited resources and travel restrictions, initiatives for eLearning are becoming more popular. Come join us as we discuss best practices and tips for groups new to eLearning content creation, and the best ways to avoid complications as you grow your eLearning library.
    In this webinar, we will take on common challenges that we have seen in eLearning deployments, and provide simple methods to avoid and overcome them. With a little training and some practice, even beginners can create engaging and effective eLearning content using Adobe Captivate and Adobe Presenter. You can even deploy content to your learners with a few clicks using the Adobe Connect Training Platform!
    Sign up today to learn how to:
    -Deliver self-paced training content that won't conflict with operational demands and unpredictable schedules
    -Create engaging and effective training material optimized for knowledge retention
    -Build curriculum featuring rich content such as quizzes, videos, and interactivity
    -Track program certifications required by Federal and State mandates
    Come join us Wednesday May 23rd at 2P ET (11A PT): http://events.carahsoft.com/event-detail/1506/realeyes/
    Jorma_at_RealEyes
    RealEyes Connect

    You can make it happen by creating a private connection for 40 users by capi script and when creating portlet select 2nd option in Users Logged in section. In this the portlet uses there own private connection every time user logs in.
    So that it won't ask for password.
    Another thing is there is an option of entering password or not in ASC in discoverer section, if your version 10.1.2.2. Let me know if you need more information
    thnaks
    kiran

  • Standards or Best Practices on limits to Adobe LiveCycle forms as data input tools?

    We are trying to determine whether we should be using Adobe LiveCycle forms for our user input pages, or use a web input form (jsf) that is part of the application server. The data captured would then be rendered in multiple output forms. (printing, etc) We've proofed that it can be done, but our experience so far is that to achieve the complex business rules, validations and calculations, there is a lot of javascript code to write. Has there been any industry assessment or best practices on determining when it is best to use a web form vs Adobe Livecycle form for capturing user input? especially when there is a lot of strict validation and business rule, backend data calls, etc?   Our input requirements also differ significantly from our output requirements- where we will definitely be using LiveCycle forms.

    It sounds like you need use the adobe schema in MII so the output of your transaction matches it.
    Regards,
    Jamie

  • Best Practices for Team Collaboration using Adobe Captivate

    With a team of 6 Instructional Designers, how can Adobe Captivate be approached where we can collaborate while producing e-learning material while maintaining a consistent look and feel of the e-learning we produce?
    What are the best practices for a team of 6 IDs working and creating e-learning material in Captivate?  Is there anything build-in that allows us to connect to the same libraries, templates, etc to share?  
    Please advise.
    Thank you!
    Susanne

    Only some tips, never collaborated with someone else, being the solo teacher. You didn't mention which version you are using, what I write here is meant for CP7.
    Be sure to prepare a theme and/or a template that will be used by everyone. A theme consists of master slides, object styles, skin editor. Master slides can have custom navigation shape buttons.  In a template you can eventually also prepare different slides with placeholders, and eventually advanced actions etc. For CP6 and earlier that is the only way to reuse advanced actions, in Captivate 7 you can export shared actions that can be imported in any project for reuse.
    A feature that few users know about are the external libraries. You can open the library of any project as an external library in another project. That is a good idea to store assets that you want to use in different projects: images, audio clips, video clips, eventually equations. The shared actions in a library can not (yet?) be used in another project however.
    If you are on CP7 you have automatically the roundtripping with source Adobe Photoshop files and source Audition files, both from CC. That can also make collaboration lot easier if those assets are prepared in those applications. Will not expand on that, because I'm not sure you have the Creative Cloud applications.
    Those are my two cents.
    Lilybiri

Maybe you are looking for

  • TRYING TO DOWNLOAD ITUNES---NOT WORKING

    got my new 30gb ipod today. went to the apple web site to download itunes. I clicked on download & the screen shifted to the next screen which indicated it had downloaded. Nothing happens after that. No install wizzard or equivalent. Background....I

  • Problems with partial selection in preview and other skim...

    I scan student work that is handwritten. I use preview to select a portion of that work and then I paste the portion of the image I have selected into pages or some other application. Since upgrading to Snow Leopard when I partially select an area in

  • Using HTTPService results for WebService

    Here's the deal.  I am using an HTTP request to get the Session Variables that I need to use in a Web Service.  How do I time it so that the resutls from the HTTP request are used in the Web Service request?  Do/Can I bind them?  Do I need to set a t

  • Same website on 2 different Tabs

    We have a site we go to for technical information and parts ordering. One User Name takes us to one company and another User Name takes us to a second company. We enter the User Name and Password and check the Remember Password box. When opening the

  • "Error getting EJB Manager": password?

    Hi,           I have just installed Weblogic 6.1 and am trying to use the examples server.After I start my server, if I want to do something minor like list all EJBs deployed, I get the following error:           >java weblogic.deploy list mypassword