Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8729277
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T08:48:20+00:00 2026-06-13T08:48:20+00:00

This question came to the JayData forum but I decided to share it here

  • 0

This question came to the JayData forum but I decided to share it here as this is an interesting topic and maybe others can benefit from it too.

by V3nom » Tue Oct 23, 2012 2:06 pm

I struggle to find information on websql transactions in JayData. Can anyone give a hint or a link ?

http://jaydata.org/forum/viewtopic.php?f=3&t=101&sid=8accd7bf5bed872b6e88d36004a280c5

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T08:48:21+00:00Added an answer on June 13, 2026 at 8:48 am

    Transactions are not an easy thing to support on a storage agnostic manner. Therefore there is no explicit transaction management with JayData, rather you can use the implicit “all or nothing” behavior of the EntityContext. With regarding webSQL each delta package (that is: a number of add/update items and a saveChanges() at the end) run in the same webSQL transaction. If an error occures during the save of any items, all previous inserts/update will be rollbacked.

    A very simple example that shows this in action: the following code inserts two items into a table, and creates a duplicate key error scenario. The end result is that there will be no rows in the table even if the second insert has been rejected being duplicate.

    $data.Entity.extend("item", {
        ID: { key: true, computed: true, type: 'int' },
        data: { type: 'string' }
    });
    
    $data.EntityContext.extend("ItemsContainer", {
        items: { type: $data.EntitySet, elementType: item }
    });
    
    var offlinedb = new ItemsContainer({
        name: 'sqLite',
        databaseName: 'itemdb'
    });
    
    function createLocalData() {
        offlinedb.items.add({ data: 'apple' });
        offlinedb.items.add({ data: 'orange', ID:1 });
        offlinedb.saveChanges(
            function () {
    
            }
        );
    }
    

    This create programmatic rollbacks you can hook the set and context level event handlers and throw an exception in them. Read more here: http://jaydata.org/blog/entitycontext-and-entityset-scoped-event-handlers-in-jaydata-1.2

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This question has actually came from my experiments with GWT framework but I decided
I came across this question on an interview questions thread. Here is the question:
I have been using java for long time but this question came to my
Yep. This question came up looking at Code Igniter but it is not really
This question came up from what I see on a clients side: Intermittent Connection
This question came to my mind when I learned C++ with a background of
This question came today in the manipulatr mailing list. http://groups.google.com/group/manipulatr/browse_thread/thread/fbab76945f7cba3f I am rephrasing. Given
This question came about because the cells gem specifies template directories using File.join('app','cells'). That
in my java class we were learning about arrays and this question came up.
What is the difference between above two? This question came to my mind because

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.