[appengine-java] Re: production memcache grabTail namespace isolation broken

2010-02-02 Thread phraktle
Hi,

In this case grabTail would be quite useless, as one cannot really
construct queues with it (ie. it would just force removing items from
all namespaces that wouldn't even expire otherwise). The documentation
also implies that there's a separate LRU list per namespace, which
does make sense, but is not what's happening in production:

http://code.google.com/appengine/docs/java/javadoc/com/google/appengine/api/memcache/MemcacheService.html#grabTail(int)

Grabs (atomically get and delete) items off the tail of LRU list.
This can be used to implement queue system with high throughput and
low latency, but low reliability. Current namespace should be set and
not empty for the service. For each namespace memcache maintains a
separate LRU list.



Regards,
  Viktor


On Feb 1, 9:22 pm, Ikai L (Google) ika...@google.com wrote:
 I'll raise the issue with some other members of the team, but it seems like
 this is working as expected. A memcache namespace is nothing more than a
 prefix applied to a memcache key. There's no true partitioning mechanism
 within memcache. grabTail simply returns the item that would be expired by
 the LRU mechanism if memcache needed more space. There isn't a different
 queue per namespace, only a queue for global expirations.





 On Mon, Feb 1, 2010 at 4:29 AM, phraktle phrak...@gmail.com wrote:
  Hi,

  On production, grabTail returns objects from other namespaces. This is
  a significant problem that
  makes grabTail (thus queue-like usage) unusable.

  I filed this as a bug, with a very simple example here:
 http://code.google.com/p/googleappengine/issues/detail?id=2706

  Can you please look into this? I don't even see a workaround that I
  can implement in the meantime...

  Thanks,
   Viktor

  --
  You received this message because you are subscribed to the Google Groups
  Google App Engine for Java group.
  To post to this group, send email to
  google-appengine-j...@googlegroups.com.
  To unsubscribe from this group, send email to
  google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2B 
  unsubscr...@googlegroups.com
  .
  For more options, visit this group at
 http://groups.google.com/group/google-appengine-java?hl=en.

 --
 Ikai Lan
 Developer Programs Engineer, Google App 
 Enginehttp://googleappengine.blogspot.com|http://twitter.com/app_engine

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Re: here is currently a bug preventing owned one-to-many relationships where the parent and the child are the same class, making it difficult to model tree structures.

2010-02-02 Thread Ian Marshall
Yes, this is datanucleus-appengine issue 80 (Recursive relation does
not work). I have starred this issue, along with 29 others.

I could not wait for the fix, so I have already worked around this
issue by having all my entities of this type:
  ·  having the same entity group parent (of a different class)
  ·  using an ArrayList[Entity] of key values to store each entity's
children
  ·  using a key value to store each entity's parent (null for the
root instance, even though it still has a entity group parent).

This is not ideal for me, but it works well.

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



Re: [appengine-java] Re: Merge join on list properties / more efficient on one list or on separate lists

2010-02-02 Thread Raphael André Bauer
On Thu, Jan 28, 2010 at 11:14 AM, Max thebb...@gmail.com wrote:
 Bump!

 In my opinion, the 2nd one performs better but use more storage.
 Because the first one fan out (n + m) copies whereas the second one
 fans out (n * m) copies.

 This is just MY THEORY. Please correct me if I am wrong.

thanks Max :)

does anybody have a pointer to a specification where I could look up
the exact time and space consumption of both querys on GAE?


Thanks,

Raphael

 Thanks a lot,

 Max

 On 1月28日, 上午1時06分, Raphael André Bauer raphael.andre.ba...@gmail.com
 wrote:
 Hi everybody,

 Suppose you have to entities. Entity1 has one list, Entity2 has two lists:

 Entity1
 ListString tags_and_timestamps

 Entity2
 ListString tags
 ListString timestamps

 (I hope the peseudocode is ok - the questions is a general datastore
 question and not dependent on JPA/JDO or low-level api).

 Then I want to merge join my entities based on two properties: a
 timestamp and on a tag.

 Entity1 is a stupid entity simply storing everyhting in one list.
 So I merge join on one list:
 tags_and_timestamps == timestamp AND tags_and_timestamps == tag

 Entity2 is separates both values, so I merge join on:
 timestamps == timestamp AND tags == tag

 The question is now: What is more efficient on the GAE datastore?
 Separating the values into different lists or storing everything in
 one list?

 Thanks a lot,

 Raphael

 --
 You received this message because you are subscribed to the Google Groups 
 Google App Engine for Java group.
 To post to this group, send email to google-appengine-j...@googlegroups.com.
 To unsubscribe from this group, send email to 
 google-appengine-java+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/google-appengine-java?hl=en.



-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Persisting during scheduled maintenance periods using JDO

2010-02-02 Thread Ian Marshall
In the GAE/J documentation under How-To | Handling Scheduled
Maintenance Periods, it states:

During this period, all datastore writes and transactions will throw
an exception. Your application can detect these errors and indicate to
the user that the application is in read-only, recommending that they
try again later.

An example is then given to catch the relevant exception during
PersistenceManager#makePersistent(...), but I cannot find an example
for datastore updates of already-existing entities.

Does anyone know at what point an update to a persistent entity (not
using PersistenceManager#makePersistent(...)) will result in the
CapabilityDisabledException exception being thrown? For example, where
in the following code extract could I expect this exception?

// Non-GAE method to return the singleton instance
PersistenceManagerFactory pmf =
DataExchange.getPersistenceManagerFactory();

PersistenceManager pm = pmf.getPersistenceManager();
Transaction tx = pm.currentTransaction();

try
{
  tx.begin();

// Non GAE method to get a detatched instance by its ID
(within the current tx)
Item itemEdit = findItemByID(tx, pidData.loID,
loLoggedOnUserID);

// Non GAE method to amend the itemEdit instance
itemEdit = updateItemWithPageItemData(tx, itemEdit, pidData,
ipmMode);

tx.commit();
}
finally
{
  try
  {
if (tx.isActive())// Because of an exception, say
{
  tx.rollback();
}
  }
  finally
  {
pm.close();
  }
}

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



Re: [appengine-java] Re: Merge join on list properties / more efficient on one list or on separate lists

2010-02-02 Thread John Patterson
I have read somewhere that all properties (lists or otherwise) are  
stored in an Entity including the property name. An Entity is a Bag of  
properties rather than a Set of Lists.  Therefore your two approaches  
would take the same amount of storage for the Entity and your two  
queries would essentially be the exactly same.  Also, every property  
generates one implicit index entry so that should also be the same.  I  
would keep the fields separate as they are logically distinct.


On 2 Feb 2010, at 17:18, Raphael André Bauer wrote:


On Thu, Jan 28, 2010 at 11:14 AM, Max thebb...@gmail.com wrote:

Bump!

In my opinion, the 2nd one performs better but use more storage.
Because the first one fan out (n + m) copies whereas the second one
fans out (n * m) copies.

This is just MY THEORY. Please correct me if I am wrong.


thanks Max :)

does anybody have a pointer to a specification where I could look up
the exact time and space consumption of both querys on GAE?


Thanks,

Raphael


Thanks a lot,

Max

On 1月28日, 上午1時06分, Raphael André Bauer  
raphael.andre.ba...@gmail.com

wrote:

Hi everybody,

Suppose you have to entities. Entity1 has one list, Entity2 has  
two lists:


Entity1
ListString tags_and_timestamps

Entity2
ListString tags
ListString timestamps

(I hope the peseudocode is ok - the questions is a general datastore
question and not dependent on JPA/JDO or low-level api).

Then I want to merge join my entities based on two properties: a
timestamp and on a tag.

Entity1 is a stupid entity simply storing everyhting in one list.
So I merge join on one list:
tags_and_timestamps == timestamp AND tags_and_timestamps == tag

Entity2 is separates both values, so I merge join on:
timestamps == timestamp AND tags == tag

The question is now: What is more efficient on the GAE datastore?
Separating the values into different lists or storing everything in
one list?

Thanks a lot,

Raphael


--
You received this message because you are subscribed to the Google  
Groups Google App Engine for Java group.
To post to this group, send email to google-appengine-java@googlegroups.com 
.
To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com 
.
For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en 
.





--
You received this message because you are subscribed to the Google  
Groups Google App Engine for Java group.
To post to this group, send email to google-appengine-java@googlegroups.com 
.
To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com 
.
For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en 
.




--
You received this message because you are subscribed to the Google Groups Google 
App Engine for Java group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Re: problem with Datastore quotas

2010-02-02 Thread Jorge
Hi Dimitar,

This is an idea. Take a closer look to your _ah_SESSION kind. It is
possible you are storing huge session data and it remains there after
the sessions expire. If that is the case, you probably want to clean
your expired sessions periodically.

Jorge Gonzalez


On Feb 1, 1:05 pm, dmakariev ani...@gmail.com wrote:
 Hi again,

 I've read the documentation. and cannot find anything related to my
 datastore growth :(,
 I'm not using indexes. It is quite simple application, demonstrating
 the usage of JSF 2. I'm using session, and I've included the
 SessionCleanupServlet in my web.xml. It is started every hour.
 So the number of entities in _ah_SESSION is round 40 .

 My other suspect was the log file. I couldn't find any description
 about where the log files are stored.
 But I've updated the version number of the application.. deleted the
 old one with the big log files, and still the total used datastore
 quota didn't decrease.

 my current status is 35% of Total Stored Data
 and at the same time : Size of all entities 414 KBytes

 I'll be really happy to know where and how to manage properly the
 datastore space.

 Best Regards:
 Dimitar Makariev

 On Feb 1, 1:38 am, John Patterson jdpatter...@gmail.com wrote:

  On the page that shows those details is a link to a doc that explains  
  where the extra space is used.  Probably indexes could consume a lot.

  On 1 Feb 2010, at 16:29, dmakariev wrote:

   Hi all,
   I have the following problem :
   my quotas show the following :
   Total Stored Data           26%     0.26 of 1.00 GBytes     Okay
   at the same time
   Datastore Statistics is showing :
   Size of all entities:  5 MBytes

   Breakdown by Property Type
   Property Type      Size
   Blob        5 MBytes
   String      14 KBytes
   Integer     12 KBytes
   Date/Time   4 KBytes
   User        51 Bytes
   NULL        24 Bytes
   Metadata    71 KBytes

   And I have no idea where is the datastore space disappearing..

   my app id is sandcode

   Does anybody has idea ? I'll appreciate your advices..

   Best Regards:
   Dimitar Makariev

   --
   You received this message because you are subscribed to the Google  
   Groups Google App Engine for Java group.
   To post to this group, send email to 
   google-appengine-java@googlegroups.com
   .
   To unsubscribe from this group, send email to 
   google-appengine-java+unsubscr...@googlegroups.com
   .
   For more options, visit this group 
   athttp://groups.google.com/group/google-appengine-java?hl=en
   .

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] AppEngine Java JDO Posting - need help

2010-02-02 Thread niraj
If anyone on this group is interested in AppEngine-Java-JDO work and
make some quick bucks please look at the posting on elance

http://shar.es/aM73b

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Re: AppEngine Java JDO Posting - need help

2010-02-02 Thread niraj
If the Last URL does not work use this

http://www.elance.com/job?jobid=19035975rid=1KDB9



On Feb 2, 7:26 am, niraj njun...@gmail.com wrote:
 If anyone on this group is interested in AppEngine-Java-JDO work and
 make some quick bucks please look at the posting on elance

 http://shar.es/aM73b

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] access compute and storage clouds with jclouds

2010-02-02 Thread Adrian Cole
jclouds is an open source framework that helps you get started in the
cloud and reuse your java development skills. Our api allows you to
freedom to use portable abstractions or cloud-specific features. We
support many clouds including Amazon, VMWare, Azure, and Rackspace.

After over 7 months and 100k lines of code, jclouds 1.0-beta-3 is out!

This release is focused on choice.  Choice of cloud providers and
choice in tooling to manage them.

Inside the jclouds distribution, you will find 15 service choices,
including EC2, Atmos, vCloud, Azure, and Rimu Hosting.  You can choose
to use these apis directly, or use a multi-cloud abstraction like
BlobStore [1] or ComputeService [2].

You can also use jclouds via ant, commons vfs, infinispan, crane
clojure, or dasein cloud apis.

As before, we've been careful to ensure everything works well in or
outside google appengine.  We even have a new spring demo to show that
off [3].
Unlike before, we now have a binary distribution you can download [4].

Please do let us know what you'd like to see from us next.

All the best,
-Adrian
founder jclouds

[1] http://code.google.com/p/jclouds/wiki/BlobStore
[2] http://code.google.com/p/jclouds/wiki/ComputeGuide
[3] http://java.dzone.com/articles/using-spring%E2%80%99s-java
[4] http://code.google.com/p/jclouds/downloads/list

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Converting Entity to Object

2010-02-02 Thread Alexandru Farcas
Is there a way of converting dynamically an Entity to a specific
Object ?
For example:
I have some Contact objects and User, Invoice etc, witch are
PersistanceCapable.
So i can make queries (javax.jdo.Query) that return lists of those
kind of objects (Contact, User, Invoice etc) or i can use app engine
datastore.Query to get lists of Entity objects.
1. Is there a simple method of converting an Entity object to a
Contact for example? but without doing smth like :
map = entitiy.getProperties();
Contact c = new Contact();
c.setProperty1(map.get(property1));
c.setProperty2()
... etc

  I want to know this because i want to use Query from the
datastore package and not javax.jdo and it doesn't seem a good
solution to make a method for each kind of entity. (I could use java
reflection to create the objects, but i think it is very complicated
since i don't know for example the types of fields and it is probably
a costly method).

2. Is the Query class form app engine datastore package more powerful
(or more suited) than the one from javax.jdo? Witch would you
recommend ?

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Need some pointers about XMLHttpRequest and Google user services

2010-02-02 Thread Shai
Hi,
I need some clarifications about how to use the Google users services
when when working with XMLHttpRequest (javascript).

For the purpose of the discussion I use the code from the Google
sample of user services:
http://code.google.com/appengine/docs/java/gettingstarted/usingusers.html

I need to load an html file that has some elements in it that I fill
from a XMLHttpRequest response (I can't use a server generated page
because I'm doing the call from a Google chrome extension and I need
the chrome api, so the html file must be packed with my extension)

My problem is handling the redirect when user is not logged in... How
would you suggest I mimic the browser behavior for the same
redirect ?
If I point my browser to same URL I will get the user log-in page and
the browser will then display the response properly (after the user
signed in).

I am not even sure what to ask, is there some kind of good practice
for doing what I need ? Loading a page with and XMLHttpReqest that
requires a redirect to the Google account login and then loading my
page again this time with the user signed in ?




-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] My application stopped working

2010-02-02 Thread Stéphane Traumat
Hello... My application as running well since some days : http://www.quatuo.com/
( quatuo-www )

Today, i connect and i see a 500 error message... no Idea why...
nothing in the logs... I tried to empty queues, redeploy and all...
but still nothing is working :(
I need help as peoples just can't use the service anymore.. and i have
no idea why.

Regards

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



Re: [appengine-java] Re: problem with Datastore quotas

2010-02-02 Thread Dombrowski, Todd
Most likely indexes -- app engine maintains an index for every query the
app engine will perform (from Programming Google App Engine)

If you have a variety of queries that use multiple properties and sort
orders, the datastore will need an index for every unique combination -- and
this is in addition to the indexes already created on every key and property
for a kind. Sort order is significant too -- you may need an index in ASC
and DESC order for a property.

Another thing to look out for: using more than one multi-valued property in
an entity. Your index on those properties basically becomes the cross
product of the values stored, which can make it huge.

If you don't have it, the book Programming Google App Engine has the best
treatment I've seen of the datastore.

Thanks,
Todd Dombrowski
pzlbox



On Tue, Feb 2, 2010 at 5:50 AM, Jorge athenas...@gmail.com wrote:

 Hi Dimitar,

 This is an idea. Take a closer look to your _ah_SESSION kind. It is
 possible you are storing huge session data and it remains there after
 the sessions expire. If that is the case, you probably want to clean
 your expired sessions periodically.

 Jorge Gonzalez


 On Feb 1, 1:05 pm, dmakariev ani...@gmail.com wrote:
  Hi again,
 
  I've read the documentation. and cannot find anything related to my
  datastore growth :(,
  I'm not using indexes. It is quite simple application, demonstrating
  the usage of JSF 2. I'm using session, and I've included the
  SessionCleanupServlet in my web.xml. It is started every hour.
  So the number of entities in _ah_SESSION is round 40 .
 
  My other suspect was the log file. I couldn't find any description
  about where the log files are stored.
  But I've updated the version number of the application.. deleted the
  old one with the big log files, and still the total used datastore
  quota didn't decrease.
 
  my current status is 35% of Total Stored Data
  and at the same time : Size of all entities 414 KBytes
 
  I'll be really happy to know where and how to manage properly the
  datastore space.
 
  Best Regards:
  Dimitar Makariev
 
  On Feb 1, 1:38 am, John Patterson jdpatter...@gmail.com wrote:
 
   On the page that shows those details is a link to a doc that explains
   where the extra space is used.  Probably indexes could consume a lot.
 
   On 1 Feb 2010, at 16:29, dmakariev wrote:
 
Hi all,
I have the following problem :
my quotas show the following :
Total Stored Data   26% 0.26 of 1.00 GBytes Okay
at the same time
Datastore Statistics is showing :
Size of all entities:  5 MBytes
 
Breakdown by Property Type
Property Type  Size
Blob5 MBytes
String  14 KBytes
Integer 12 KBytes
Date/Time   4 KBytes
User51 Bytes
NULL24 Bytes
Metadata71 KBytes
 
And I have no idea where is the datastore space disappearing..
 
my app id is sandcode
 
Does anybody has idea ? I'll appreciate your advices..
 
Best Regards:
Dimitar Makariev
 
--
You received this message because you are subscribed to the Google
Groups Google App Engine for Java group.
To post to this group, send email to
 google-appengine-java@googlegroups.com
.
To unsubscribe from this group, send email to
 google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com
.
For more options, visit this group athttp://
 groups.google.com/group/google-appengine-java?hl=en
.

 --
 You received this message because you are subscribed to the Google Groups
 Google App Engine for Java group.
 To post to this group, send email to
 google-appengine-j...@googlegroups.com.
 To unsubscribe from this group, send email to
 google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/google-appengine-java?hl=en.



-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] non-deterministic datastore behaviour while unit testing

2010-02-02 Thread Markus Scheidgen
Hi,

I use junit to unit test my app according to the Unit Testing With
Local Service Implementations tutorial. Once I use owned
relationships within my data-model, the datastore sometimes behaves
unexpected. Objects and links stored in the datastore, sometimes can
not be read from the data store. The data store behaves as if those
objects or links have never been stored. In some runs everything
behaves like it ought to be, in other runs it doesn't. Especially when
I use the eclipse debug mode, the test-cases often have different
outcomes than running them without a debugger.

What troubles me the most, is the non-deterministic scheme. Sometimes
it works, sometimes it doesn't.

So far, I only had this during unit testing. When using the
development server or the cloud, everything worked out as it should.

Does anybody had experienced something similar? Any hind? Maybe there
is some common pit-fall in using the jdo data store or owned
relationships (even though I use it along the documentation and
tutorials).

Thanks,
Markus

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Datastore migration

2010-02-02 Thread Moritz
Hello everyone,

after a couple of versions of my application I found out that I need
to change the datamodel fundamentally in order to achieve better
performance. My approach was as follows:

(Coding)
- Mark all old API as @Deprecated
- Create new classes etc.
- Update views etc.
- Develop a migration servlet which copies data from the old model to
the new model
(Migration)
- Deploy new app
- Call migration servlet URL

All tests on my local development environment were successful. The new
datamodel is less complex than the old one, it contains only
implicit relations and stores large data in a separate entity. That
perfectly matches the application's scope, only minor refactorings
were necessary to implement the new datamodel.

However, the migration failed. Of course, I had already so much data
in the system, that the request timed out. Now my datastore is half
old and half new.

Bummer.

Luckily, that application is not really in production, so it is not a
fatal loss.

However, I'm wondering how such migration is usually done.
- How do I backup my datastore?
- How do I run migration scripts (in my case =servlet)?

Thank you,
Moritz

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



Re: [appengine-java] Re: production memcache grabTail namespace isolation broken

2010-02-02 Thread Ikai L (Google)
That's interesting. Let me follow up with the team to try to understand how
this is supposed to work.

On Tue, Feb 2, 2010 at 12:05 AM, phraktle phrak...@gmail.com wrote:


 Plus, it's working okay in the development server :)

 V.

 On Feb 2, 9:03 am, phraktle phrak...@gmail.com wrote:
  Hi,
 
  In this case grabTail would be quite useless, as one cannot really
  construct queues with it (ie. it would just force removing items from
  all namespaces that wouldn't even expire otherwise). The documentation
  also implies that there's a separate LRU list per namespace, which
  does make sense, but is not what's happening in production:
 
  http://code.google.com/appengine/docs/java/javadoc/com/google/appengi..
 .)
 
  Grabs (atomically get and delete) items off the tail of LRU list.
  This can be used to implement queue system with high throughput and
  low latency, but low reliability. Current namespace should be set and
  not empty for the service. For each namespace memcache maintains a
  separate LRU list.
 
  Regards,
Viktor
 
  On Feb 1, 9:22 pm, Ikai L (Google) ika...@google.com wrote:
 
 
 
   I'll raise the issue with some other members of the team, but it seems
 like
   this is working as expected. A memcache namespace is nothing more than
 a
   prefix applied to a memcache key. There's no true partitioning
 mechanism
   within memcache. grabTail simply returns the item that would be expired
 by
   the LRU mechanism if memcache needed more space. There isn't a
 different
   queue per namespace, only a queue for global expirations.
 
   On Mon, Feb 1, 2010 at 4:29 AM, phraktle phrak...@gmail.com wrote:
Hi,
 
On production, grabTail returns objects from other namespaces. This
 is
a significant problem that
makes grabTail (thus queue-like usage) unusable.
 
I filed this as a bug, with a very simple example here:
   http://code.google.com/p/googleappengine/issues/detail?id=2706
 
Can you please look into this? I don't even see a workaround that I
can implement in the meantime...
 
Thanks,
 Viktor
 
--
You received this message because you are subscribed to the Google
 Groups
Google App Engine for Java group.
To post to this group, send email to
google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to
google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.comgoogle-appengine-java%2B
 unsubscr...@googlegroups.com
.
For more options, visit this group at
   http://groups.google.com/group/google-appengine-java?hl=en.
 
   --
   Ikai Lan
   Developer Programs Engineer, Google App Enginehttp://
 googleappengine.blogspot.com|http://twitter.com/app_engine

 --
 You received this message because you are subscribed to the Google Groups
 Google App Engine for Java group.
 To post to this group, send email to
 google-appengine-j...@googlegroups.com.
 To unsubscribe from this group, send email to
 google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/google-appengine-java?hl=en.




-- 
Ikai Lan
Developer Programs Engineer, Google App Engine
http://googleappengine.blogspot.com | http://twitter.com/app_engine

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



Re: [appengine-java] Converting Entity to Object

2010-02-02 Thread John Patterson
You can check out Twig or Objectify which all aim to do what you are  
asking about.


Twig is higher level - more like an Object database built on top of  
the datastore in which you use the native low-level Queries.   
Objectify is more low level in that you handle relationships between  
objects manually with Keys but has great docs.  Both make use of  
generics to make your code more maintainable.


http://code.google.com/p/twig-persist/

On 2 Feb 2010, at 18:08, Alexandru Farcas wrote:


Is there a way of converting dynamically an Entity to a specific
Object ?
For example:
I have some Contact objects and User, Invoice etc, witch are
PersistanceCapable.
So i can make queries (javax.jdo.Query) that return lists of those
kind of objects (Contact, User, Invoice etc) or i can use app engine
datastore.Query to get lists of Entity objects.
1. Is there a simple method of converting an Entity object to a
Contact for example? but without doing smth like :
   map = entitiy.getProperties();
   Contact c = new Contact();
   c.setProperty1(map.get(property1));
   c.setProperty2()
   ... etc

 I want to know this because i want to use Query from the
datastore package and not javax.jdo and it doesn't seem a good
solution to make a method for each kind of entity. (I could use java
reflection to create the objects, but i think it is very complicated
since i don't know for example the types of fields and it is probably
a costly method).

2. Is the Query class form app engine datastore package more powerful
(or more suited) than the one from javax.jdo? Witch would you
recommend ?

--
You received this message because you are subscribed to the Google  
Groups Google App Engine for Java group.
To post to this group, send email to google-appengine-java@googlegroups.com 
.
To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com 
.
For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en 
.




--
You received this message because you are subscribed to the Google Groups Google 
App Engine for Java group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



Re: [appengine-java] Converting Entity to Object

2010-02-02 Thread Scott Hernandez
http://code.google.com/p/objectify-appengine

(it seems it got truncated from John's message)

On Tue, Feb 2, 2010 at 10:32 AM, John Patterson jdpatter...@gmail.com wrote:
 You can check out Twig or Objectify which all aim to do what you are asking
 about.

 Twig is higher level - more like an Object database built on top of the
 datastore in which you use the native low-level Queries.  Objectify is more
 low level in that you handle relationships between objects manually with
 Keys but has great docs.  Both make use of generics to make your code more
 maintainable.

 http://code.google.com/p/twig-persist/

 On 2 Feb 2010, at 18:08, Alexandru Farcas wrote:

 Is there a way of converting dynamically an Entity to a specific
 Object ?
 For example:
 I have some Contact objects and User, Invoice etc, witch are
 PersistanceCapable.
 So i can make queries (javax.jdo.Query) that return lists of those
 kind of objects (Contact, User, Invoice etc) or i can use app engine
 datastore.Query to get lists of Entity objects.
 1. Is there a simple method of converting an Entity object to a
 Contact for example? but without doing smth like :
       map = entitiy.getProperties();
       Contact c = new Contact();
       c.setProperty1(map.get(property1));
       c.setProperty2()
       ... etc

     I want to know this because i want to use Query from the
 datastore package and not javax.jdo and it doesn't seem a good
 solution to make a method for each kind of entity. (I could use java
 reflection to create the objects, but i think it is very complicated
 since i don't know for example the types of fields and it is probably
 a costly method).

 2. Is the Query class form app engine datastore package more powerful
 (or more suited) than the one from javax.jdo? Witch would you
 recommend ?

 --
 You received this message because you are subscribed to the Google Groups
 Google App Engine for Java group.
 To post to this group, send email to
 google-appengine-j...@googlegroups.com.
 To unsubscribe from this group, send email to
 google-appengine-java+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/google-appengine-java?hl=en.


 --
 You received this message because you are subscribed to the Google Groups
 Google App Engine for Java group.
 To post to this group, send email to google-appengine-j...@googlegroups.com.
 To unsubscribe from this group, send email to
 google-appengine-java+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/google-appengine-java?hl=en.



-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



Re: [appengine-java] Can't run the Java version of GAE.

2010-02-02 Thread Don Schwarz
Sorry, I don't really have any theories.  No one else has ever
reported this, so lets start with what makes your machine unique.

What JRE are you running?  Can you try a Sun 1.5 or 1.6 VM if you're
not already using one?

Is there anything special about the networking on your machine?  IPv6
support?  Multiple IPv4 networks?  etc.

Does specifying an alternate port with -p work?

On Fri, Jan 29, 2010 at 1:36 PM, Tordek ked...@gmail.com wrote:
 Tordek wrote:

 I wanted to try out Clojure in GAE, so I downloaded the Java SDK, but
 I can't run the demo apps: I get this error.

 ~/src/JavaGae$ ./appengine-java-sdk-1.3.0/bin/dev_appserver.sh
 appengine-java-sdk-1.3.0/demos/guestbook/war/
 26-Jan-2010 19:00:50 com.google.apphosting.utils.jetty.JettyLogger
 warn
 WARNING: failed selectchannelconnec...@127.0.0.1:8080
 java.net.SocketException: Invalid argument
        at sun.nio.ch.Net.bind(Native Method)
        at sun.nio.ch.ServerSocketChannelImpl.bind
 (ServerSocketChannelImpl.java:119)
        at sun.nio.ch.ServerSocketAdaptor.bind
 (ServerSocketAdaptor.java:59)
        at org.mortbay.jetty.nio.SelectChannelConnector.open
 (SelectChannelConnector.java:211)
        at org.mortbay.jetty.nio.SelectChannelConnector.doStart
 (SelectChannelConnector.java:309)
        at org.mortbay.component.AbstractLifeCycle.start
 (AbstractLifeCycle.java:40)
        at org.mortbay.jetty.Server.doStart(Server.java:228)
        at org.mortbay.component.AbstractLifeCycle.start
 (AbstractLifeCycle.java:40)
        at

 com.google.appengine.tools.development.JettyContainerService.startContainer
 (JettyContainerService.java:188)
        at
 com.google.appengine.tools.development.AbstractContainerService.startup
 (AbstractContainerService.java:120)
        at
 com.google.appengine.tools.development.DevAppServerImpl.start
 (DevAppServerImpl.java:217)
        at com.google.appengine.tools.development.DevAppServerMain
 $StartAction.apply(DevAppServerMain.java:162)
        at com.google.appengine.tools.util.Parser$ParseResult.applyArgs
 (Parser.java:48)
        at
 com.google.appengine.tools.development.DevAppServerMain.init
 (DevAppServerMain.java:113)
        at com.google.appengine.tools.development.DevAppServerMain.main
 (DevAppServerMain.java:89)
 26-Jan-2010 19:00:50 com.google.apphosting.utils.jetty.JettyLogger
 warn
 WARNING: failed ser...@7eb1cc87
 java.net.SocketException: Invalid argument
        at sun.nio.ch.Net.bind(Native Method)
        at sun.nio.ch.ServerSocketChannelImpl.bind
 (ServerSocketChannelImpl.java:119)
        at sun.nio.ch.ServerSocketAdaptor.bind
 (ServerSocketAdaptor.java:59)
        at org.mortbay.jetty.nio.SelectChannelConnector.open
 (SelectChannelConnector.java:211)
        at org.mortbay.jetty.nio.SelectChannelConnector.doStart
 (SelectChannelConnector.java:309)
        at org.mortbay.component.AbstractLifeCycle.start
 (AbstractLifeCycle.java:40)
        at org.mortbay.jetty.Server.doStart(Server.java:228)
        at org.mortbay.component.AbstractLifeCycle.start
 (AbstractLifeCycle.java:40)
        at

 com.google.appengine.tools.development.JettyContainerService.startContainer
 (JettyContainerService.java:188)
        at
 com.google.appengine.tools.development.AbstractContainerService.startup
 (AbstractContainerService.java:120)
        at
 com.google.appengine.tools.development.DevAppServerImpl.start
 (DevAppServerImpl.java:217)
        at com.google.appengine.tools.development.DevAppServerMain
 $StartAction.apply(DevAppServerMain.java:162)
        at com.google.appengine.tools.util.Parser$ParseResult.applyArgs
 (Parser.java:48)
        at
 com.google.appengine.tools.development.DevAppServerMain.init
 (DevAppServerMain.java:113)
        at com.google.appengine.tools.development.DevAppServerMain.main
 (DevAppServerMain.java:89)
 java.net.SocketException: Invalid argument
        at sun.nio.ch.Net.bind(Native Method)
        at sun.nio.ch.ServerSocketChannelImpl.bind
 (ServerSocketChannelImpl.java:119)
        at sun.nio.ch.ServerSocketAdaptor.bind
 (ServerSocketAdaptor.java:59)
        at org.mortbay.jetty.nio.SelectChannelConnector.open
 (SelectChannelConnector.java:211)
        at org.mortbay.jetty.nio.SelectChannelConnector.doStart
 (SelectChannelConnector.java:309)
        at org.mortbay.component.AbstractLifeCycle.start
 (AbstractLifeCycle.java:40)
        at org.mortbay.jetty.Server.doStart(Server.java:228)
        at org.mortbay.component.AbstractLifeCycle.start
 (AbstractLifeCycle.java:40)
        at

 com.google.appengine.tools.development.JettyContainerService.startContainer
 (JettyContainerService.java:188)
        at
 com.google.appengine.tools.development.AbstractContainerService.startup
 (AbstractContainerService.java:120)
        at
 com.google.appengine.tools.development.DevAppServerImpl.start
 (DevAppServerImpl.java:217)
        at com.google.appengine.tools.development.DevAppServerMain
 $StartAction.apply(DevAppServerMain.java:162)
        at 

Re: [appengine-java] My application stopped working

2010-02-02 Thread Ikai L (Google)
This issue should have been resolved:
http://groups.google.com/group/google-appengine-downtime-notify/browse_thread/thread/7fb8a39149de3b55

http://groups.google.com/group/google-appengine-downtime-notify/browse_thread/thread/7fb8a39149de3b55Please
let us know if you are continuing to be affected.

On Tue, Feb 2, 2010 at 6:40 AM, Stéphane Traumat stephane.trau...@gmail.com
 wrote:

 Hello... My application as running well since some days :
 http://www.quatuo.com/
 ( quatuo-www )

 Today, i connect and i see a 500 error message... no Idea why...
 nothing in the logs... I tried to empty queues, redeploy and all...
 but still nothing is working :(
 I need help as peoples just can't use the service anymore.. and i have
 no idea why.

 Regards

 --
 You received this message because you are subscribed to the Google Groups
 Google App Engine for Java group.
 To post to this group, send email to
 google-appengine-j...@googlegroups.com.
 To unsubscribe from this group, send email to
 google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/google-appengine-java?hl=en.




-- 
Ikai Lan
Developer Programs Engineer, Google App Engine
http://googleappengine.blogspot.com | http://twitter.com/app_engine

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



Re: [appengine-java] non-deterministic datastore behaviour while unit testing

2010-02-02 Thread Ikai L (Google)
Can you post test cases that produce non-deterministic behavior? If this is
reproducible, please create an issue with the entities and test cases in
question and let us know:

http://code.google.com/p/googleappengine/issues/

On Tue, Feb 2, 2010 at 6:48 AM, Markus Scheidgen 
markus.scheid...@googlemail.com wrote:

 Hi,

 I use junit to unit test my app according to the Unit Testing With
 Local Service Implementations tutorial. Once I use owned
 relationships within my data-model, the datastore sometimes behaves
 unexpected. Objects and links stored in the datastore, sometimes can
 not be read from the data store. The data store behaves as if those
 objects or links have never been stored. In some runs everything
 behaves like it ought to be, in other runs it doesn't. Especially when
 I use the eclipse debug mode, the test-cases often have different
 outcomes than running them without a debugger.

 What troubles me the most, is the non-deterministic scheme. Sometimes
 it works, sometimes it doesn't.

 So far, I only had this during unit testing. When using the
 development server or the cloud, everything worked out as it should.

 Does anybody had experienced something similar? Any hind? Maybe there
 is some common pit-fall in using the jdo data store or owned
 relationships (even though I use it along the documentation and
 tutorials).

 Thanks,
 Markus

 --
 You received this message because you are subscribed to the Google Groups
 Google App Engine for Java group.
 To post to this group, send email to
 google-appengine-j...@googlegroups.com.
 To unsubscribe from this group, send email to
 google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/google-appengine-java?hl=en.




-- 
Ikai Lan
Developer Programs Engineer, Google App Engine
http://googleappengine.blogspot.com | http://twitter.com/app_engine

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



Re: [appengine-java] non-deterministic datastore behaviour while unit testing

2010-02-02 Thread John Patterson
You say that you experience this when debugging - do you see any  
exceptions being thrown?  One common exception I see during long  
debugging sessions is Handle 7 found or similar.  But these do not  
occur on the production servers.



On 3 Feb 2010, at 02:52, Ikai L (Google) wrote:

Can you post test cases that produce non-deterministic behavior? If  
this is reproducible, please create an issue with the entities and  
test cases in question and let us know:


http://code.google.com/p/googleappengine/issues/

On Tue, Feb 2, 2010 at 6:48 AM, Markus Scheidgen markus.scheid...@googlemail.com 
 wrote:

Hi,

I use junit to unit test my app according to the Unit Testing With
Local Service Implementations tutorial. Once I use owned
relationships within my data-model, the datastore sometimes behaves
unexpected. Objects and links stored in the datastore, sometimes can
not be read from the data store. The data store behaves as if those
objects or links have never been stored. In some runs everything
behaves like it ought to be, in other runs it doesn't. Especially when
I use the eclipse debug mode, the test-cases often have different
outcomes than running them without a debugger.

What troubles me the most, is the non-deterministic scheme. Sometimes
it works, sometimes it doesn't.

So far, I only had this during unit testing. When using the
development server or the cloud, everything worked out as it should.

Does anybody had experienced something similar? Any hind? Maybe there
is some common pit-fall in using the jdo data store or owned
relationships (even though I use it along the documentation and
tutorials).

Thanks,
Markus

--
You received this message because you are subscribed to the Google  
Groups Google App Engine for Java group.
To post to this group, send email to google-appengine-java@googlegroups.com 
.
To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com 
.
For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en 
.





--
Ikai Lan
Developer Programs Engineer, Google App Engine
http://googleappengine.blogspot.com | http://twitter.com/app_engine

--
You received this message because you are subscribed to the Google  
Groups Google App Engine for Java group.
To post to this group, send email to google-appengine-java@googlegroups.com 
.
To unsubscribe from this group, send email to google-appengine-java+unsubscr...@googlegroups.com 
.
For more options, visit this group at http://groups.google.com/group/google-appengine-java?hl=en 
.


--
You received this message because you are subscribed to the Google Groups Google 
App Engine for Java group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Eclipse GAE plugin problem with Datanucleus enrichment

2010-02-02 Thread Joe Hudson
Hello,

I am using the Google App Engine Eclipse plugin and get an error when
I save a Java class with a get(String) method.

The enhancer is throwing a NullPointerException. I have added the
transient annotation and don't know what else I can do to avoid this
issue. Can anyobody please give me some advice?

I am using datanucleus-jpa-1.1.5.jar

I also posted this to the datanucleus forum but there doesn't seem to
be too much activity there so I was hoping I would get some ideas here
as well.  http://www.jpox.org/servlet/forum/viewthread_thread,5954#31824

Thank you very much.

The referenced code is below:

@Entity
public class TestEntity implements Serializable {

private String dummyProperty;

public String getDummyProperty() {
return dummyProperty;
}

public void setDummyProperty(String dummyProperty) {
this.dummyProperty = dummyProperty;
}

@Transient
public Object get(String key) {
return null;
}
}


And, here is the stack trace:

DataNucleus Enhancer (version 1.1.4) : Enhancement of classes
Errors were encountered when loading the specified MetaData files and
classes. See the nested exceptions for details
Feb 2, 2010 1:45:24 PM org.datanucleus.enhancer.DataNucleusEnhancer
main
SEVERE: DataNucleus Enhancer completed with an error. Please review
the enhancer log for full details. Some classes may have been enhanced
but some caused errors
Errors were encountered when loading the specified MetaData files and
classes. See the nested exceptions for details
org.datanucleus.exceptions.NucleusUserException: Errors were
encountered when loading the specified MetaData files and classes. See
the nested exceptions for details
at org.datanucleus.metadata.MetaDataManager.loadClasses
(MetaDataManager.java:426)
at org.datanucleus.enhancer.DataNucleusEnhancer.getFileMetadataForInput
(DataNucleusEnhancer.java:743)
at org.datanucleus.enhancer.DataNucleusEnhancer.enhance
(DataNucleusEnhancer.java:545)
at org.datanucleus.enhancer.DataNucleusEnhancer.main
(DataNucleusEnhancer.java:1252)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.google.appengine.tools.enhancer.Enhancer.execute(Enhancer.java:
57)
at com.google.appengine.tools.enhancer.Enhance.init(Enhance.java:60)
at com.google.appengine.tools.enhancer.Enhance.main(Enhance.java:41)
Caused by: java.lang.NullPointerException
at
org.datanucleus.jpa.metadata.JPAAnnotationReader.processMemberAnnotations
(JPAAnnotationReader.java:8
53)
at
org.datanucleus.metadata.annotations.AbstractAnnotationReader.getMetaDataForClass
(AbstractAnnotation
Reader.java:159)
at
org.datanucleus.metadata.annotations.AnnotationManagerImpl.getMetaDataForClass
(AnnotationManagerImpl
.java:136)
at org.datanucleus.metadata.MetaDataManager.loadAnnotationsForClass
(MetaDataManager.java:2278)
at org.datanucleus.metadata.MetaDataManager.loadClasses
(MetaDataManager.java:385)
... 10 more
Nested Throwables StackTrace:
DataNucleus Enhancer completed with an error. Please review the
enhancer log for full details. Some classes may have been enhanced but
some caused errors
java.lang.NullPointerException
DataNucleus Enhancer completed and no classes were enhanced. Consult
the log for full details
at
org.datanucleus.jpa.metadata.JPAAnnotationReader.processMemberAnnotations
(JPAAnnotationReader.java:8
53)
at
org.datanucleus.metadata.annotations.AbstractAnnotationReader.getMetaDataForClass
(AbstractAnnotation
Reader.java:159)
at
org.datanucleus.metadata.annotations.AnnotationManagerImpl.getMetaDataForClass
(AnnotationManagerImpl
.java:136)
at org.datanucleus.metadata.MetaDataManager.loadAnnotationsForClass
(MetaDataManager.java:2278)
at org.datanucleus.metadata.MetaDataManager.loadClasses
(MetaDataManager.java:385)
at org.datanucleus.enhancer.DataNucleusEnhancer.getFileMetadataForInput
(DataNucleusEnhancer.java:743)
at org.datanucleus.enhancer.DataNucleusEnhancer.enhance
(DataNucleusEnhancer.java:545)
at org.datanucleus.enhancer.DataNucleusEnhancer.main
(DataNucleusEnhancer.java:1252)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke
(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke
(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.google.appengine.tools.enhancer.Enhancer.execute(Enhancer.java:
57)
at com.google.appengine.tools.enhancer.Enhance.init(Enhance.java:60)
at com.google.appengine.tools.enhancer.Enhance.main(Enhance.java:41)

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-j...@googlegroups.com.

Re: [appengine-java] Can't use hessian with appengine

2010-02-02 Thread Olemis Lang
On Wed, May 20, 2009 at 6:06 AM, Konstantin Solomatov
konstantin.soloma...@gmail.com wrote:

 Hello,

 I wanted to use Hessian in my appengine application http://hessian.caucho.com/
 When I test code locally everything works well. When I deploy to the
 app engine, things go awry. If I send a request to there I get the
 following exception:

 Exception in thread main
 com.caucho.hessian.client.HessianConnectionException: 501:
 java.io.IOException: Server returned HTTP response code: 501 for URL

 How can I find out where the problem is? What isn't implemented there?


Probably related to this [1]_ ?

.. [1] Webservice on Google App Engine - Google App Engine for Java ...

(http://groups.google.com/group/google-appengine-java/browse_thread/thread/0068bf08c5fd3fef/4edb06eb6f316689?lnk=raot)

-- 
Regards,

Olemis.

Blog ES: http://simelo-es.blogspot.com/
Blog EN: http://simelo-en.blogspot.com/

Featured article:
Sobrepasa las 1000 descargas el módulo TracGViz (300 desde PyPI) -
http://feedproxy.google.com/~r/simelo-es/~3/DdGeJirDqUk/sobrepasa-las-1000-descargas-el-modulo.html

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Re: non-deterministic datastore behaviour while unit testing

2010-02-02 Thread Markus Scheidgen
No, no caught or uncaught exception what so ever.

I tried to create a very simple version of what I was doing. The
simplest example, I could imagine, is the following:

public class OwnedRelationships extends LocalServiceTestCase {

@PersistenceCapable(identityType = IdentityType.APPLICATION)
static class Parent {

@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
@PrimaryKey
Key key;

@Persistent
Child child;

@Persistent
String value;
}

@PersistenceCapable(identityType = IdentityType.APPLICATION)
static class Child {
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
@PrimaryKey
Key key;

@Persistent
String value;
}

public void testOneToOne() {
PersistenceManager pm = PMF.get().getPersistenceManager();

Parent parent = new Parent();
Child child = new Child();
parent.value = parent1;
child.value = child1;
parent.child = child;

try {
pm.makePersistent(parent);
} finally {
pm.close();
}

pm = PMF.get().getPersistenceManager();
Parent controlParent = null;
try {
controlParent = pm.getObjectById(Parent.class, 
parent.key);
} finally {
pm.close();
}

assertTrue(controlParent.child != null);  // some times
controlParent.child is null, sometimes it is not
assertTrue(controlParent.child.equals(child1));
}
}

This simple example, actually never works. But I think it should work,
shouldn't it?

The next example, is the actual code that caused the arbitrary
behaviour. Sometimes it works, sometimes it doesn't. Once compiled, it
behaves the same way on every run. But you change it a little bit,
maybe comment some unimportant line, and it stops working.

public class DBTest extends LocalServiceTestCase {

public void testPlayerWithComments() {
PlayerDB player = PlayerDB.createDefault(test1);
CommentDB comment = CommentDB.createDefault();
comment.setAuthor(player);
player.getComments().add(comment);

PersistenceManager pm = PMF.get().getPersistenceManager();
try {
pm.makePersistent(player);
} finally {
pm.close();
}
pm = PMF.get().getPersistenceManager();
try {
PlayerDB controlPlayerObject = 
pm.getObjectById(PlayerDB.class,
test1);
assertTrue(comment not persistet in player,
controlPlayerObject.getComments().size() == 1);  // the list is
sometimes empty, even though it should contain one comment

CommentDB controlCommentObject = 
pm.getObjectById(CommentDB.class,
controlPlayerObject.getComments().get(0).getKey());
assertTrue(cannot navigate to player,

controlCommentObject.getAuthor(pm).getId().equals
(controlPlayerObject.getId()));

CollectionCommentDB comments = 
(CollectionCommentDB)pm.newQuery
(CommentDB.class).execute();
assertTrue(comment not loadable with query, 
comments.size() ==
1);
} finally {
pm.close();
}
}
}

@PersistenceCapable(identityType=IdentityType.APPLICATION)
public class CommentDB {

public static CommentDB createDefault() {
CommentDB result = new CommentDB();
result.setComment();
return result;
}

private CommentDB() {

}

@PrimaryKey
@Persistent(valueStrategy=IdGeneratorStrategy.IDENTITY)
private Key key;

@Persistent
private Text comment;

@Persistent
private String author;

@Persistent
private Key owner;

public String getComment() {
return comment.getValue();
}

public void setComment(String comment) {
this.comment = new Text(comment);
}

public PlayerDB getAuthor(PersistenceManager pm) {
return pm.getObjectById(PlayerDB.class, author);
}

public void setAuthor(PlayerDB author) {
this.author = author.getId();
}

public T T getOwner(PersistenceManager pm, ClassT ownerType) {
return pm.getObjectById(ownerType, owner);
}

public void setOwner(Key owner) {
this.owner = owner;
}


Re: [appengine-java] Re: Unsupported method contains while parsing expression:

2010-02-02 Thread Ikai L (Google)
Oy, this is what I get for not running code before posting it. Good looking
out.

On Tue, Feb 2, 2010 at 1:06 AM, datanucleus andy_jeffer...@yahoo.comwrote:

 query.setFilter(aliases == alias);

 That is invalid JDOQL syntax; the spec is the spec and JDOQL uses Java
 syntax.
 If you have a collection field then the filter should be

 aliases.contains(:alias)

 The poster put the colon in front of a field name (wrong), and
 declared a parameter as a variable (wrong).

 --
 You received this message because you are subscribed to the Google Groups
 Google App Engine for Java group.
 To post to this group, send email to
 google-appengine-j...@googlegroups.com.
 To unsubscribe from this group, send email to
 google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/google-appengine-java?hl=en.




-- 
Ikai Lan
Developer Programs Engineer, Google App Engine
http://googleappengine.blogspot.com | http://twitter.com/app_engine

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



Re: [appengine-java] Can't use hessian with appengine

2010-02-02 Thread Jeff Schnitzer
FWIW, it's actually quite easy to check out Resin trunk (which holds
the hessian source code), make the patch, build with ant, and get a
hessian.jar.

Hessian works quite beautifully on appengine.  I wish I had an
asynchronous ObjectiveC hessian client so I could ditch my tediously
duplicated JAX-RS api.

Jeff

On Tue, Feb 2, 2010 at 1:19 PM, Olemis Lang ole...@gmail.com wrote:
 On Wed, May 20, 2009 at 6:06 AM, Konstantin Solomatov
 konstantin.soloma...@gmail.com wrote:

 Hello,

 I wanted to use Hessian in my appengine application 
 http://hessian.caucho.com/
 When I test code locally everything works well. When I deploy to the
 app engine, things go awry. If I send a request to there I get the
 following exception:

 Exception in thread main
 com.caucho.hessian.client.HessianConnectionException: 501:
 java.io.IOException: Server returned HTTP response code: 501 for URL

 How can I find out where the problem is? What isn't implemented there?


 Probably related to this [1]_ ?

 .. [1] Webservice on Google App Engine - Google App Engine for Java ...
        
 (http://groups.google.com/group/google-appengine-java/browse_thread/thread/0068bf08c5fd3fef/4edb06eb6f316689?lnk=raot)

 --
 Regards,

 Olemis.

 Blog ES: http://simelo-es.blogspot.com/
 Blog EN: http://simelo-en.blogspot.com/

 Featured article:
 Sobrepasa las 1000 descargas el módulo TracGViz (300 desde PyPI) -
 http://feedproxy.google.com/~r/simelo-es/~3/DdGeJirDqUk/sobrepasa-las-1000-descargas-el-modulo.html

 --
 You received this message because you are subscribed to the Google Groups 
 Google App Engine for Java group.
 To post to this group, send email to google-appengine-j...@googlegroups.com.
 To unsubscribe from this group, send email to 
 google-appengine-java+unsubscr...@googlegroups.com.
 For more options, visit this group at 
 http://groups.google.com/group/google-appengine-java?hl=en.



-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Need to update the type of primary key on existing objects in GAE Java

2010-02-02 Thread shaz
Hi,

I am building a web app using GAE Java. I have a class that uses a
Long ID as its primary key.

I now want to create a new class that would be the parent class to
this original class (a one to many relationship) however the children
that already exist need to have a primary key of type key, not the
Long ID I have now.

What is the best way to change the primary key to be type key
instead of long for the existing persisted entities? Should I create a
new class with primary key of type key and instantiate and persist
new objects that copy the field values from the old ones? Or can I
somehow just update the existing class?

Thanks

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Re: memcache SerializationException

2010-02-02 Thread chiappone
Is it even possible to use memcache with GWT on the server side?  I am
wondering if I am even able to do this?

On Feb 1, 1:56 pm, chiappone chiapp...@gmail.com wrote:
 I have hit the wall in trying to figure out what I am doing wrong in
 my GAE GWT application.  I am trying to use memcache to get a list of
 serializable objects out of the cache in a service.  It seems to put
 them fine, and I can see them being pulled from cache in the debugger
 but I end up getting the following exception:

 This is the call to pull the object out of cache:
 ListModel ecDevices = (ListModel) cache.findInCache(partitionKey);
                 if(ecDevices != null  ecDevices.size()  0){
                         log.info(Returning devices from cache);
                         return ecDevices;
                 }...

 SEVERE: [1265057364142000] javax.servlet.ServletContext log: Exception
 while dispatching incoming RPC call
 com.google.gwt.user.client.rpc.SerializationException:
 java.lang.reflect.InvocationTargetException
         at
 com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.seriali 
 zeWithCustomSerializer
 (ServerSerializationStreamWriter.java:760)
         at
 com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.seriali 
 zeImpl
 (ServerSerializationStreamWriter.java:723)
         at
 com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.seriali ze
 (ServerSerializationStreamWriter.java:612)
         at
 com.google.gwt.user.client.rpc.impl.AbstractSerializationStreamWriter.write 
 Object
 (AbstractSerializationStreamWriter.java:129)
         at com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter
 $ValueWriter$8.write(ServerSerializationStreamWriter.java:152)
         at
 com.google.gwt.user.server.rpc.impl.ServerSerializationStreamWriter.seriali 
 zeValue
 (ServerSerializationStreamWriter.java:534)
         at com.google.gwt.user.server.rpc.RPC.encodeResponse(RPC.java:609)
         at com.google.gwt.user.server.rpc.RPC.encodeResponseForSuccess
 (RPC.java:467)
         at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse
 (RPC.java:564)
         at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall
 (RemoteServiceServlet.java:188)
         at com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost
 (RemoteServiceServlet.java:224)
         at com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost
 (AbstractRemoteServiceServlet.java:62)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:713)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
         at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:
 487)
         at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter
 (ServletHandler.java:1093)
         at com.google.appengine.api.blobstore.dev.ServeBlobFilter.doFilter
 (ServeBlobFilter.java:51)
         at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter
 (ServletHandler.java:1084)
         at
 com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter
 (TransactionCleanupFilter.java:43)
         at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter
 (ServletHandler.java:1084)
         at com.google.appengine.tools.development.StaticFileFilter.doFilter
 (StaticFileFilter.java:121)
         at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter
 (ServletHandler.java:1084)
         at org.mortbay.jetty.servlet.ServletHandler.handle
 (ServletHandler.java:360)
         at org.mortbay.jetty.security.SecurityHandler.handle
 (SecurityHandler.java:216)
         at org.mortbay.jetty.servlet.SessionHandler.handle
 (SessionHandler.java:181)
         at org.mortbay.jetty.handler.ContextHandler.handle
 (ContextHandler.java:712)
         at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:
 405)
         at com.google.apphosting.utils.jetty.DevAppEngineWebAppContext.handle
 (DevAppEngineWebAppContext.java:70)
         at org.mortbay.jetty.handler.HandlerWrapper.handle
 (HandlerWrapper.java:139)
         at com.google.appengine.tools.development.JettyContainerService
 $ApiProxyHandler.handle(JettyContainerService.java:352)
         at org.mortbay.jetty.handler.HandlerWrapper.handle
 (HandlerWrapper.java:139)
         at org.mortbay.jetty.Server.handle(Server.java:313)
         at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:
 506)
         at org.mortbay.jetty.HttpConnection$RequestHandler.content
 (HttpConnection.java:844)
         at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:644)
         at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
         at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:381)
         at org.mortbay.io.nio.SelectChannelEndPoint.run
 (SelectChannelEndPoint.java:396)
         at org.mortbay.thread.BoundedThreadPool$PoolThread.run
 (BoundedThreadPool.java:442)
 Caused by: 

[appengine-java] dynamic class load

2010-02-02 Thread javaness
Hi;

I am trying Java on Eclipse by App engine plugin.

Is it possible to dynamically load classes? (maybe hot-swapping is the
correct term)

In an another project, I use Jetty plugin of Maven, and whenever I
compile a java class, Jetty automically loads it.
So no restart is needed on code modifications.

Is that possible on Eclipse configuration of App Engine.

Thanks;

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



Re: [appengine-java] dynamic class load

2010-02-02 Thread Ikai L (Google)
Yes. Run your server using Debug. Eclipse will automatically compile your
classes on save.

The only exception is certain types of changes to classes that need to be
enhanced after compilation. Eclipse will prompt you to restart.

On Tue, Feb 2, 2010 at 4:04 PM, javaness enesa...@gmail.com wrote:

 Hi;

 I am trying Java on Eclipse by App engine plugin.

 Is it possible to dynamically load classes? (maybe hot-swapping is the
 correct term)

 In an another project, I use Jetty plugin of Maven, and whenever I
 compile a java class, Jetty automically loads it.
 So no restart is needed on code modifications.

 Is that possible on Eclipse configuration of App Engine.

 Thanks;

 --
 You received this message because you are subscribed to the Google Groups
 Google App Engine for Java group.
 To post to this group, send email to
 google-appengine-j...@googlegroups.com.
 To unsubscribe from this group, send email to
 google-appengine-java+unsubscr...@googlegroups.comgoogle-appengine-java%2bunsubscr...@googlegroups.com
 .
 For more options, visit this group at
 http://groups.google.com/group/google-appengine-java?hl=en.




-- 
Ikai Lan
Developer Programs Engineer, Google App Engine
http://googleappengine.blogspot.com | http://twitter.com/app_engine

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Re: Can't compile Guestbook demo modified as in the video

2010-02-02 Thread SD
Any deployable demo involving the datastore?
So far was able to deploy only hello-world-type applications, no luck
with the datastore-linked guestbook.

Tried to deploy code from:
http://googleappengine.googlecode.com/svn›
trunk›
java›
demos›
jdoexamples

but it did not work either.

Kept modifying the code and was getting different 500 errors (once it
was 403),
ranging from C:\Users\SD\AppData\Local\Temp
\Jetty_127_0_0_1__war-g0qk00\jsp\org\apache\jsp
\guestbook_jsp.java:162: 'catch' without 'try'
to
java.lang.ExceptionInInitializerError
at org.apache.jsp.guestbook_jsp._jspService(guestbook_jsp.java:62)
to
java.lang.NoClassDefFoundError: Could not initialize class
com.google.guestbook.PMF


This is what I get when trying to deploy.

Unable to update:
com.google.appengine.tools.admin.JspCompilationException: Failed to
compile the generated JSP java files.
at com.google.appengine.tools.admin.Application.compileJavaFiles
(Application.java:416)
at com.google.appengine.tools.admin.Application.compileJsps
(Application.java:376)
at com.google.appengine.tools.admin.Application.createStagingDirectory
(Application.java:252)
at com.google.appengine.tools.admin.AppAdminImpl.update
(AppAdminImpl.java:54)
at com.google.appengine.eclipse.core.proxy.AppEngineBridgeImpl.deploy
(AppEngineBridgeImpl.java:271)
at
com.google.appengine.eclipse.core.deploy.DeployProjectJob.runInWorkspace
(DeployProjectJob.java:148)
at org.eclipse.core.internal.resources.InternalWorkspaceJob.run
(InternalWorkspaceJob.java:38)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)


Any insight? Thanks a lot,
SD

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Re: Restrict which google accounts can access the app

2010-02-02 Thread hendrix.jason
I think this is what you are looking for:
http://code.google.com/appengine/docs/java/config/webxml.html#Security_and_Authentication


On Jan 31, 2:55 pm, Scott gocards...@gmail.com wrote:
 I read that you can make people login to their google account in order
 gain access to your app, but is there a way to restrict access to only
 certain google account??

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Re: Object state from a query

2010-02-02 Thread Brandon
Thx. Can the state only be determined at runtime, or there is a
general rule? I appreciate if you can let me know whether each match
is retrieved in an independent transaction.

Thx again.

On Feb 2, 12:04 am, datanucleus andy_jeffer...@yahoo.com wrote:
 JDOHelper.getObjectState(obj) ?

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] is google app engine a real-time cloud?

2010-02-02 Thread smile laugh
hello everyone

someone said that cloud computing is not real-time platform.

that is to say, if you insert a record into cloud(such as bigtable),
and then if you query the record immediately , maybe no rowset
returned.
because in a cloud platform, a record is store in lots of server , at
that time when you query that inserted record , some server may not be
synchronized , and your query is done in those server

is that true?

thanks in advance

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



Re: [appengine-java] Two ManyToOne relationships in one class

2010-02-02 Thread Ikai L (Google)
The explanation for the exception is in the exception text itself. Each
entity's key contains the ancestor information for that entity:

http://code.google.com/appengine/articles/storage_breakdown.html

http://code.google.com/appengine/articles/storage_breakdown.htmlA path is
a concatenation of entity keys. Every path begins with the key of the root
entity (which may be the current entity itself) in the current entity group.
If the current entity is not the root, then the key of each ancestor is
appended to the path, from top to bottom, until the current entity's key is
appended.

That is, if you persist Venue before persisting its parent, you get the key
Venue(ID). Were you to persist the ancestors first, you would get an
unencoded key of Person(PERSON_ID)/TIP(TIP_ID)/Venue(VENUE_ID).

You've got a few options here:

1. Store the Key instead. This won't force the entities into an entity group
relationship. The tradeoff here is that you lose the ability to perform
transactions on these entities.

2. Restructure your entity groups. Remember that these are in a tree-like
hierarchy with a root entity and child entities. This limits the way you can
design one-to-many relationships without using keys, as entities cannot be
part of multiple entity groups. Our docs on this are here:
http://code.google.com/appengine/docs/java/datastore/relationships.html

On Sun, Jan 31, 2010 at 6:28 AM, Wong lhw...@gmail.com wrote:


 In my application I have bi-directional one-to-many relationship
 between Venue and Tip.

 @Entity
 public class Venue implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Key key;


@OneToMany(cascade = CascadeType.ALL, mappedBy=venue)

private ListTip tips;


 @Entity
 public class Tip implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Key key;

private Integer version;



@ManyToOne(fetch = FetchType.LAZY)
private Venue venue;


 I have venue object persisted and then tip is added to the venue. I
 don't any any problem in doing this.

 Venue venue = venueService.find(key);
 venue.addTip(tip);
 venueService.merge(venue);


 Then I expand the relationship to have another bi-directional one-to-
 many relationship between Person and Tip. Tip is posted by a Person
 and for a Venue. One Person can post more than one Tips for a Venue.

 @Entity
 public class Tip implements Serializable {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Key key;

@ManyToOne(fetch = FetchType.LAZY)
private Venue venue;

@ManyToOne(fetch = FetchType.LAZY)
private Person postedBy;


 @Entity
 public class Person implements Serializable, UserDetails {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Key key;

@OneToMany(cascade = CascadeType.ALL, mappedBy=postedBy)
private ListTip tips;


 Venue venue = venueService.find(key);
 Person person = personService.find(userId);
 venue.addTip(tip);
 person.addTip(tip);
 venueService.merge(venue);


 I am getting the following error:

 Detected attempt to establish Person(29)/Tip(125) as the parent of
 Venue(2) but the entity identified by Venue(2) has already been
 persisted without a parent. A parent cannot be established or changed
 once an object has been persisted.
 org.datanucleus.store.appengine.FatalNucleusUserException: Detected
 attempt to establish Person(29)/Tip(125) as the parent of Venue(2) but
 the entity identified by Venue(2) has already been persisted without a
 parent. A parent cannot be established or changed once an object has
 been persisted. at

 org.datanucleus.store.appengine.DatastoreRelationFieldManager.checkForParentSwitch
 (DatastoreRelationFieldManager.java:204) at
 org.datanucleus.store.appengine.DatastoreRelationFieldManager
 $1.setObjectViaMapping(DatastoreRelationFieldManager.java:125) at
 org.datanucleus.store.appengine.DatastoreRelationFieldManager$1.apply
 (DatastoreRelationFieldManager.java:104) at

 org.datanucleus.store.appengine.DatastoreRelationFieldManager.storeRelations
 (DatastoreRelationFieldManager.java:78) at
 org.datanucleus.store.appengine.DatastoreFieldManager.storeRelations
 (DatastoreFieldManager.java:812) at

 org.datanucleus.store.appengine.DatastorePersistenceHandler.insertPostProcess
 (DatastorePersistenceHandler.java:288) at
 org.datanucleus.store.appengine.DatastorePersistenceHandler.insertObjects
 (DatastorePersistenceHandler.java:241) at
 org.datanucleus.store.appengine.DatastorePersistenceHandler.insertObject
 (DatastorePersistenceHandler.java:225) at
 org.datanucleus.state.JDOStateManagerImpl.internalMakePersistent
 (JDOStateManagerImpl.java:3185) at
 org.datanucleus.state.JDOStateManagerImpl.flush
 (JDOStateManagerImpl.java:4513) at
 org.datanucleus.sco.SCOUtils.validateObjectForWriting(SCOUtils.java:
 1494) at

 

[appengine-java] Re: Can't run the Java version of GAE.

2010-02-02 Thread seleronm
Hi.

Though it might be unrelated

Please refer to the following links
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=560044


Please Try.
thanks.


On 2月3日, 午前4:23, Don Schwarz schwa...@google.com wrote:
 Sorry, I don't really have any theories.  No one else has ever
 reported this, so lets start with what makes your machine unique.

 What JRE are you running?  Can you try a Sun 1.5 or 1.6 VM if you're
 not already using one?

 Is there anything special about the networking on your machine?  IPv6
 support?  Multiple IPv4 networks?  etc.

 Does specifying an alternate port with -p work?

 On Fri, Jan 29, 2010 at 1:36 PM, Tordek ked...@gmail.com wrote:
  Tordek wrote:

  I wanted to try out Clojure in GAE, so I downloaded the Java SDK, but
  I can't run the demo apps: I get this error.

  ~/src/JavaGae$ ./appengine-java-sdk-1.3.0/bin/dev_appserver.sh
  appengine-java-sdk-1.3.0/demos/guestbook/war/
  26-Jan-2010 19:00:50 com.google.apphosting.utils.jetty.JettyLogger
  warn
  WARNING: failed selectchannelconnec...@127.0.0.1:8080
  java.net.SocketException: Invalid argument
         at sun.nio.ch.Net.bind(Native Method)
         at sun.nio.ch.ServerSocketChannelImpl.bind
  (ServerSocketChannelImpl.java:119)
         at sun.nio.ch.ServerSocketAdaptor.bind
  (ServerSocketAdaptor.java:59)
         at org.mortbay.jetty.nio.SelectChannelConnector.open
  (SelectChannelConnector.java:211)
         at org.mortbay.jetty.nio.SelectChannelConnector.doStart
  (SelectChannelConnector.java:309)
         at org.mortbay.component.AbstractLifeCycle.start
  (AbstractLifeCycle.java:40)
         at org.mortbay.jetty.Server.doStart(Server.java:228)
         at org.mortbay.component.AbstractLifeCycle.start
  (AbstractLifeCycle.java:40)
         at

  com.google.appengine.tools.development.JettyContainerService.startContainer
  (JettyContainerService.java:188)
         at
  com.google.appengine.tools.development.AbstractContainerService.startup
  (AbstractContainerService.java:120)
         at
  com.google.appengine.tools.development.DevAppServerImpl.start
  (DevAppServerImpl.java:217)
         at com.google.appengine.tools.development.DevAppServerMain
  $StartAction.apply(DevAppServerMain.java:162)
         at com.google.appengine.tools.util.Parser$ParseResult.applyArgs
  (Parser.java:48)
         at
  com.google.appengine.tools.development.DevAppServerMain.init
  (DevAppServerMain.java:113)
         at com.google.appengine.tools.development.DevAppServerMain.main
  (DevAppServerMain.java:89)
  26-Jan-2010 19:00:50 com.google.apphosting.utils.jetty.JettyLogger
  warn
  WARNING: failed ser...@7eb1cc87
  java.net.SocketException: Invalid argument
         at sun.nio.ch.Net.bind(Native Method)
         at sun.nio.ch.ServerSocketChannelImpl.bind
  (ServerSocketChannelImpl.java:119)
         at sun.nio.ch.ServerSocketAdaptor.bind
  (ServerSocketAdaptor.java:59)
         at org.mortbay.jetty.nio.SelectChannelConnector.open
  (SelectChannelConnector.java:211)
         at org.mortbay.jetty.nio.SelectChannelConnector.doStart
  (SelectChannelConnector.java:309)
         at org.mortbay.component.AbstractLifeCycle.start
  (AbstractLifeCycle.java:40)
         at org.mortbay.jetty.Server.doStart(Server.java:228)
         at org.mortbay.component.AbstractLifeCycle.start
  (AbstractLifeCycle.java:40)
         at

  com.google.appengine.tools.development.JettyContainerService.startContainer
  (JettyContainerService.java:188)
         at
  com.google.appengine.tools.development.AbstractContainerService.startup
  (AbstractContainerService.java:120)
         at
  com.google.appengine.tools.development.DevAppServerImpl.start
  (DevAppServerImpl.java:217)
         at com.google.appengine.tools.development.DevAppServerMain
  $StartAction.apply(DevAppServerMain.java:162)
         at com.google.appengine.tools.util.Parser$ParseResult.applyArgs
  (Parser.java:48)
         at
  com.google.appengine.tools.development.DevAppServerMain.init
  (DevAppServerMain.java:113)
         at com.google.appengine.tools.development.DevAppServerMain.main
  (DevAppServerMain.java:89)
  java.net.SocketException: Invalid argument
         at sun.nio.ch.Net.bind(Native Method)
         at sun.nio.ch.ServerSocketChannelImpl.bind
  (ServerSocketChannelImpl.java:119)
         at sun.nio.ch.ServerSocketAdaptor.bind
  (ServerSocketAdaptor.java:59)
         at org.mortbay.jetty.nio.SelectChannelConnector.open
  (SelectChannelConnector.java:211)
         at org.mortbay.jetty.nio.SelectChannelConnector.doStart
  (SelectChannelConnector.java:309)
         at org.mortbay.component.AbstractLifeCycle.start
  (AbstractLifeCycle.java:40)
         at org.mortbay.jetty.Server.doStart(Server.java:228)
         at org.mortbay.component.AbstractLifeCycle.start
  (AbstractLifeCycle.java:40)
         at

  com.google.appengine.tools.development.JettyContainerService.startContainer
  (JettyContainerService.java:188)
         at
  

[appengine-java] Performance of count entity

2010-02-02 Thread Max
Hi,

I am designing my data model and planning to use following KeysOnly
query to perform a count(*) with some filter conditions by a daily
cron job.

FetchOptions fetchOptions = FetchOptions.Builder.withOffset(0).limit
(Integer.MAX_VALUE);
DatastoreService.prepare(query).asList(fetchOptions).size();

Here are my questions:
1, if I use an ancestor query (in a transaction) over an entity group
with around 1 million records of this kind, how is the performance?

2, if I use an ancestor query without a transaction (to avoid locking
whole entity group), how is the performance?

3, if I use a normal query over around 1k entity groups with around 10
million records of this kind, how is the performance?

Many thanks.

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Re: Memcache data life cycle

2010-02-02 Thread Max
Thanks, I have done some experiments which support your point.

On Jan 17, 7:11 pm, Qian Qiao qian.q...@gmail.com wrote:
 On Sun, Jan 17, 2010 at 19:04, Max thebb...@gmail.com wrote:
  Hi GAE gurus,

  Is there anyone who can tell me the life-cycle of data cached in
  memcache?

  I found those cached in memcache won't be expired even I re-deploy my
  project. Does that means I can use it like a datastore without
  transaction support?

  Best regards,
  Max

 No, you can't use it as a datastore, it is only a cache as the name
 suggests, even if you set the cache entries to never expire, it might
 end up being replaced when the underlying system thinks necessary.

 -- Joe

 --
 Two things that are infinite, the universe and my stupidity, and I'm
 not sure about the universe.

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Seeing owned/child entities in the datastore viewer

2010-02-02 Thread Daniel Benamy
Hi,

I'm trying to find a way to see the relationships between entities in
the data store viewer. If I have:
class A {
B foo;
}
and I'm looking at an instance of A in the data store viewer, is there
any way for me to find its B? I feel like this should be pretty simple
and maybe I'm just missing something dumb but I've searched a bunch
and can't figure this out. I know I can work backwards and find a
parent from its child by decoding its key. But my app can obviously go
the other way and it would make my life easier if I could too. Can
anyone help?

Thanks,
Dan

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Re: Object state from a query

2010-02-02 Thread datanucleus
Obviously the state has a general rule; the JDO spec.
Just that you can use JDOHelper.getObjectState to tell you what is the
rule, since it follows the spec

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Re: GAE For Java with struts2 And I am not able to access development admin console

2010-02-02 Thread MKumar
Thanks Andy Booth,

You had answered very well to my problem, Now I got the nudge of the
problem. I will opt my self for this scenario.

Mrityunjay Kumar

On Feb 1, 6:05 pm, andy.booth andy.booth...@googlemail.com wrote:
 This occurs with most frameworks that use a filter with a wildcard
 mapping to dispatch all requests, the Development server's admin
 Servlets are no longer found, and are instead being processed by the
 your framework (Struts).

 filter-mapping
         filter-nameframeworkDispatcher/filter-name
         url-pattern/*/url-pattern
 /filter-mapping

 I'm unsure on the best way to resolve this - as I'm not from a Java
 background, I don't know the best way to set up the filter mappings.

 However, when I required access to the Admin in Development, I simply
 temporarily commented out the framework's default filter with the
 wildcard mapping, accessed the Admin, then added the filter again when
 needing to run the app.

 Andy

 On Jan 30, 1:11 pm, MKumar m.kumar1...@gmail.com wrote:

  Hi,
  I am using JAVA GAE , Everything is working fine, but I am not able to
  access the Admin console, which as given in documentation can be
  accessed usinghttp://localhost:myport/_ah/admin

  But its giving me following error:
  HTTP ERROR: 404

  There is no Action mapped for namespace /_ah and action name admin.
  RequestURI=/_ah/admin

  For your information, I had neither used data storage, or queing etc.
  in application, But wanted to directly enter some data using admin
  console.

  Please give me some idea so I can access the admin console for data
  entery on development server.

  Thanks
  Mrityunjay Kumar

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Re: is google app engine a real-time cloud?

2010-02-02 Thread smile laugh
Enrique Perez

thank you so so much

laughsmile

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Re: is google app engine a real-time cloud?

2010-02-02 Thread mete
Hello Enrique,

You have said that it is possible to hit 2 different datacenters. I
believe appengine has a single primary dc and other one is just a
passive failover. Am I wrong on this ? Does appengine have multiple
active dcs ?

Thanks.

Mete

On Feb 3, 5:47 am, Enrique Perez enrique.m.pe...@gmail.com wrote:
 Ok, so I will take a shot at this one

 Alot of the non-SQL datastores emerging are implementing consistency
 models known as Eventually Consistent.  SimpleDb at Amazon is one of
 these.  The idea is that when your thread of execution writes to the
 datastore your write call returns back from the datastore write call
 fairly quickly and if you tried to read back your newly written entity
 you may or may not get it back.  But, eventually you would, maybe some
 number of seconds later. There are many systems we use this
 consistency model today.  Email, for example

 Per Ryan Barrett, in Google I/O 2008 - Under the hood of datastore, he
 described App Engine datastore as Strongly Consistent.  Other well
 known Strongly Consistent systems you might have used are relational
 databases or file systems.  When you write an entity to the App Engine
 datastore, the call blocks and only returns after the entity is
 written to the entity table, and all indexes rows are written or
 updated.  Within the same thread of execution, if you were to try to
 read back your entity you would always get it back.

 Now, there is another factor at play here which I have observed with
 apps running in production. If you running your primary browser doing
 datastore writes, you can open a second browser on different machine
 and bring up your dataviewer. After you perform a write on browser #1,
 you can refresh your second browser which is pointing to the data
 viewer.  Quite often you will not see the results of write from
 browser #1 until some seconds later.  I assumed that this was related
 to the fact that the second browser was hitting a different data
 center, or datastore clustor, and the replication from datastore
 clustor #1 to datastore clustor #2 had not yet occurred.  In Google I/
 O - 2009 - Weekend Projects - Barrett describes App Engine Multi-
 homing techniqes.  App Engine datastore is using Master-Slave
 replication system which is I believe explaining why my browser #2
 takes some seconds to see the change.

 However, even with this behavior related to Multi-homing Master-Slave
 replication in place, the App Engine datastore is still described as
 Strongly Consistent.  If one were to implement Multi-Homing Master-
 Slave replication with relational database technology I believe one
 would still see the type of behavior I have just described.

 Hopefully this make sense and I have explained this correctly.  If I
 have gotten something wrong I would love to get a better understanding
 of this.  I love to hear any more detailed information on how things
 work under the hood from those that know ...

 Thanks
 Enrique Perez
 Austin, Texas

 On Feb 2, 8:09 pm, smile laugh uni...@gmail.com wrote: hello everyone

  someone said that cloud computing is not real-time platform.

  that is to say, if you insert a record into cloud(such as bigtable),
  and then if you query the record immediately , maybe no rowset
  returned.
  because in a cloud platform, a record is store in lots of server , at
  that time when you query that inserted record , some server may not be
  synchronized , and your query is done in those server

  is that true?

  thanks in advance

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Re: Incorrect number of entities returned

2010-02-02 Thread aswath satrasala
Hello
Anything wrong here.
I have two classes Tenant and SecurityGroup.
* Create Tenant
* Create SecurityGroup
* Add SecurityGroup to Tenant
* Persist.

* Create another SecurityGroup entity.
* Persist

When I query the datastore for SecurityGroup entities, I get back one entity
instead of two.

Any ideas?

Following is the code for the two classes.
@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class Tenant {
@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
@Extension(vendorName = datanucleus, key=gae.encoded-pk,
value=true)
private String id;

@Persistent
@Extension(vendorName = datanucleus, key=gae.pk-name, value=true)
private String name;

@Persistent
private ListSecurityGroup secGrpList = new ArrayListSecurityGroup();
}

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class SecurityGroup {

@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
@Extension(vendorName = datanucleus, key = gae.encoded-pk, value =
true)
private String id;

@Persistent
@Extension(vendorName = datanucleus, key = gae.pk-name, value =
true)
private String name;
}

Thanks


On Thu, Jan 28, 2010 at 5:14 PM, aswath satrasala 
aswath.satras...@gmail.com wrote:

 I have the following unittest code.  I am persisting two SecurityGroup
 entities, one as a child of Tenant and one entity not having any parent.

 beginTxn();
 Tenant tenant = new Tenant();
 SecurityGroup securityGroup = new SecurityGroup();
 securityGroup.setName(PARTYMGRADMIN);
 tenant.getSecGrpList().add(securityGroup);
 pm.makePersistent(tenant);
 commitTxn();

 beginTxn();
 securityGroup = new SecurityGroup();
 securityGroup.setName(PARTYMGRADMIN1);
 pm.makePersistent(securityGroup);
 commitTxn();

 beginTxn();
 Query q = pm.newQuery(SecurityGroup.class);
 ListSecurityGroup results = (ListSecurityGroup) q.execute();
 assertEquals(2, results.size());
 commitTxn();

 I get results.size() as one. I am expecting the results.size() as two

 -Aswath


-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.



[appengine-java] Re: Converting Entity to Object

2010-02-02 Thread vbart
1. you can also try AuDAO, which allows you to generate DAO layer over
GAE low-level datastore API. The DAO layer also includes the methods
for converting between DTO (e.g. Contact, User) and GAE Entity
objects, so you do not need to write them manually - they can be
generated. The way of conversion is the fastest one - no reflection is
used.
http://audao.spoledge.com

2. I think that the low-level API Query class is not so powerful as
the JDO's one - no !=, IN nor .contains()... operands and
methods are supported. But it is probably faster - as it is the low-
level API which also the JDO framework probably uses.

Also in JDO you can dynamically construct queries using JDOQL. In low-
level API you must explicitly call method query.setFilter() for each
property.
So as a part of AuDAO we developed a free GQL parser (you can download
sources from the audao site). Using it, you can also create dynamic
low-level queries:
Query lowLevelQuery  = new GqlDynamic().parseQuery( SELECT * FROM
Contact WHERE firstName=:1 AND lastName=:2, Jack, Black);

Vaclav

On Feb 2, 12:08 pm, Alexandru Farcas alexfarca...@gmail.com wrote:
 Is there a way of converting dynamically an Entity to a specific
 Object ?
 For example:
 I have some Contact objects and User, Invoice etc, witch are
 PersistanceCapable.
 So i can make queries (javax.jdo.Query) that return lists of those
 kind of objects (Contact, User, Invoice etc) or i can use app engine
 datastore.Query to get lists of Entity objects.
 1. Is there a simple method of converting an Entity object to a
 Contact for example? but without doing smth like :
         map = entitiy.getProperties();
         Contact c = new Contact();
         c.setProperty1(map.get(property1));
         c.setProperty2()
         ... etc

       I want to know this because i want to use Query from the
 datastore package and not javax.jdo and it doesn't seem a good
 solution to make a method for each kind of entity. (I could use java
 reflection to create the objects, but i think it is very complicated
 since i don't know for example the types of fields and it is probably
 a costly method).

 2. Is the Query class form app engine datastore package more powerful
 (or more suited) than the one from javax.jdo? Witch would you
 recommend ?

-- 
You received this message because you are subscribed to the Google Groups 
Google App Engine for Java group.
To post to this group, send email to google-appengine-j...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine-java+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine-java?hl=en.