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 8235611
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T18:52:05+00:00 2026-06-07T18:52:05+00:00

Write to datastore Key dataKey = KeyFactory.createKey(Datastore, 123); DatastoreService datastore = DatastoreServiceFactory.getDatastoreService(); Entity data

  • 0

Write to datastore

Key dataKey = KeyFactory.createKey("Datastore", "123");
DatastoreService datastore = DatastoreServiceFactory.getDatastoreService();
Entity data = new Entity("Datastore", dataKey);
data.setProperty("date", date);

try{
   datastore.get(dataKey);
   datastore.delete(dataKey);
}catch(EntityNotFoundException ex){
   log.serve("Error : "+ ex.getMessage());
}

datastore.put(data);

Read from datastore

Key dataKey = KeyFactory.createKey("Datastore", "123");
DatastoreService datastore = DatastoreServiceFactory.getDatastoreService();
Entity entity = datastore.get(dataKey);

I have 02 questions:

1. I use datastore.get(dataKey) to check whether the entity is existed or not, because I want to avoid duplicated entity with same key but I don’t think the way i’m using is good. Is there any other way can do it better?

2. I can’t get data back. It said that ” No entity was found matching the key: Datastore(“123″)”

I read google datastore documentation again and again but I still can’t find out what wrong with this :(.

Can somebody help me please ?

Thank you.

  • 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-07T18:52:07+00:00Added an answer on June 7, 2026 at 6:52 pm

    Replace:

    Entity data = new Entity("Datastore", dataKey)
    

    with:

    Entity data = new Entity(dataKey)
    

    Also you don’t need to worry about duplicates, if you commit an existing entry (which its key is already in the datastore) it will be override. There can’t be two same keys in the datastore.

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

Sidebar

Related Questions

I'm having a very strange problem. I'm using dfs-datastores Pail abstraction to write data
We write application with Corona SDK for new cell phones like iPhone4 and SamsungGalaxy2.
i write this in .emacs (require 'dired-x) (global-set-key (kbd C-x C-j) 'dired-jump) but when
I have an entity in my app engine datastore. There's actually only one instance
I have a web application with some data in its datastore. I have just
I am attempting to write a C# application connecting to a Cognos TM1 datastore
I need to write an application that sends data to the Google App Engine
I'm trying to write a Python class that acts like some sort of datastore.
I have hierarchical data stored in the datastore using a model which looks like
I'm trying to write suitable method of converting appengine/datastore.Time type to string. This type

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.