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

  • SEARCH
  • Home
  • 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 7603655
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T23:42:43+00:00 2026-05-30T23:42:43+00:00

I use GDataDB as online INI file to save user’s settings on clouds. I

  • 0

I use GDataDB as online INI file to save user’s settings on “clouds”. I use single spreadsheet like below:

 username   create     update       expire          amount
 3600001    20120303   20120303     20180303        9
 3600001    20120303   20120303     20160303        9
 3600020    20120301   20120303     20190505        14

I wonder what happens at concurrent writes/updates. I mean is it safe? What do you think?

Here are the codes: As you see it’s a low chance to access the file at the same time but I ask for future reference, to see it can be used or not on heavy -not to much- read-write operations. Or can I implement a lock mechanism?

        public class License
        {
            public string username { get; set; }
            public string create { get; set; }
            public string update { get; set; }
            public string expire { get; set; }
            public double amount { get; set; }
        }



        private static void Main(string[] args) {


            string myaccount = "xxxxxxxxxx@gmail.com";
            string mypass = "xxxxxxxxxxxxxxxx";
            string spreadsheet = "licence";

            string username = "03600001";
            double amount = 9.0d; //bucks
            int extend = 1; //year

            // create the DatabaseClient passing my Gmail or Google Apps credentials
            IDatabaseClient client = new DatabaseClient(myaccount, mypass);

            // get or create the database. This is the spreadsheet file 
            IDatabase db = client.GetDatabase(spreadsheet) ?? client.CreateDatabase(spreadsheet);

            // get or create the table. This is a worksheet in the file 
            // note I am using my Person object so it knows what my schema needs to be  
            // for my data. It will create a header row with the property names 
            ITable<License> table = db.GetTable<License>(spreadsheet) ?? db.CreateTable<License>(spreadsheet);




            var license = new License();


            IList<IRow<License>> rows = table.FindStructured(String.Format("username={0}", username)).OrderByDescending(o => o.Element.expire).Take(1).ToList();

            if (rows == null || rows.Count == 0)
            {
                //add new
                license.username = username;
                license.create = DateTime.Now.ToString("yyyyMMdd");
                license.update = license.create;
                license.expire = DateTime.Now.AddYears(extend).ToString("yyyyMMdd");
                license.amount = amount;

                table.Add(license);
            }
            else
            {
                //update
                IRow<License> row = rows[0];

                DateTime expire = DateTime.ParseExact(row.Element.expire, "yyyyMMdd", null);

                row.Element.expire = expire.AddYears(extend).ToString("yyyyMMdd");
                row.Element.update = DateTime.Now.ToString("yyyyMMdd");
                row.Element.amount = amount;

                row.Update();
            }

          }
  • 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-05-30T23:42:44+00:00Added an answer on May 30, 2026 at 11:42 pm

    As far as I know there should be no problem. Of course, since there is no built-in locking mechanisms, the last update to a particular cell will win, unless you implement a locking mechanism yourself.

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

Sidebar

Related Questions

use Control::CLI; $cli = new Control::CLI('SSH'); $cli->connect(Host=>'10.10.10.10',Username=>'user',Password=>'pwd'); $cli->waitfor('>'); $cli->print('Show XXXXXXXXXXXXXXXXXXXX| grep Active'); @f=$cli->waitfor('>'); print
Use case: 3rd party application wants to programatically monitor a text file being generated
Use case: user clicks the link on a webpage - boom! load of files
Use Case When a user goes to my website, they will be confronted with
Use case: User launches app The user enters google password The app lets the
use warnings; use Test::More; use File::Find::Rule; use Test::File::Find::Rule; my $rule = File::Find::Rule->file->name('*.pl')->not_grep(qr/^\s*use\s+strict;/m, sub {
Use Html element SELECT in aspx page like: <SELECT id=MySelection name=MySelection runat=server DataValueField=ID DataTextField=Name></SELECT>
Use: The user searches for a partial postcode such as 'RG20' which should then
Use trap to capture signals like this: i=-1;while((++i<33)); do trap echo $i >> log.txt
Use Case: End-User searches for something and an ArrayCollection is returned with Result objects.

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.