Re: [appengine-java] problem with documentation

2010-01-28 Thread Cristian Nicanor Babula

Hi,

I don't think it's a good approach to explain the datastore relationship 
types by using tree-related terms, because a tree implies that a child 
could be accessed only by it's parent and that is absolutely contrary to 
the datastore. I think "owned" and "unowned" are the best attributes for 
describing datastore relationship types.


On 01/27/2010 11:43 PM, Rusty Wright wrote:
When I'm learning something new one of the things that slows me down 
is poor documentation.  I think the app engine java documentation 
Storing Data could be improved if it used consistent terminology in 
the area of entity groups, which is a crucial part of understanding 
how the data store works.


Sometimes the documentation uses the terms owned and unowned 
relationships, sometimes the terms parent and child.  I'm thinking 
that the owned and unowned terms aren't the best choice since you 
can't use them to say anything about a child.  To my way of thinking 
an owned relationship is a parented relationship.  But then you can't 
say that an unowned relationship is an unparented relationship since 
the owned entity could have a parent.  Perhaps you could call it a 
nonparented relationship?  Or maybe a nonparenting relationship?


Overall I much prefer the terms parent and child; the data is stored 
with a tree structure and parent and child are the natural terms when 
talking about trees.  I also think that if the terms parent and child 
were used instead of owned (and unowned) that it could help people 
more quickly understand that the structure in the data store is a tree.




--
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] How do you get a generated ID value of an persistent object in JDO using datanucleus rdbms?

2010-01-28 Thread ivanceras
When you instanciate a persisten object in google app engine the
object automatically is assigned with a value to its primary field
even before persisting it in the database.

sample class:
MyClass{
@PrimaryKey @Persistent(valueStrategy=IdGeneratorStrategy.IDENTITY)
private Long id;
}

But in the case with rdbms, the primary field is not assigned with a
value. Its value is created when the persistent object is saved into
the database. But I need to use the value of its primary field before
persisting it. What is the proper way to do this, in a sense it would
also work using any other underlying supported datasource?

-- 
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] App Engine cold starts and overly aggressive cycling

2010-01-28 Thread Miroslav Genov

Hello,
 I have similar problem. Here are my application details:

- What is your application ID?
  Application ID: cmsevobg

- How do you know it is being cycled out? You'll need to insert some 
code that only gets called when the app cold starts.
  I have a ServletContextListener that is logging "ContextInitialized" 
as an info message.


- How much time of inactivity does it take before your application is 
cycled out?

  1-3 mins and sometimes shortly

- What time or days does this seem to happen?
  Permanently

- What frameworks or libraries are you loading?
  Server side libraries: Google Guice, warp-persist , Gson
  Client Side: GWT, GIN

- Other Information
 Currently application has a ping servlet and we are pinging it to keep 
application up. Today we made a test to stop it and it seems that 
application is forced to sleep after 1-3 minutes.


Note that same code of my application was deployed and on evobgadm and 
it seems that is working correctly.  It would be really nice if this 
could be fixed, cause currently I can't import my existing
data from cmsevobg into evobgadm or some any other application due the 
fact that bulkloader is throwing me some strange exceptions.



Regards,
 Miroslav


Ikai Lan wrote:

Hey everybody,

We've been seeing more and more reports of applications being cycled 
out overly aggressively, resulting in some folks implementing 
(discouraged) workarounds to keep their application from being cycled 
out. The primary symptom of this problem is that your application will 
see lots of "loading requests" that fire up a new JVM, which, as many 
of you know can take anywhere from a few seconds with naked servlets 
to as much as twenty seconds when loading something like Spring MVC, 
JRuby on Rails or Grails.


In theory, there is enough capacity such that as long as you get some 
traffic every few hours, you should not be getting cycled out, but we 
have been seeing reports of applications being cycled after only a 
minute or less. To help us figure out if these are app specific issues 
or App Engine issues, can you post the following information if you 
believe this is happening to you?


- What is your application ID?
- How do you know it is being cycled out? You'll need to insert some 
code that only gets called when the app cold starts.
- How much time of inactivity does it take before your application is 
cycled out?

- What time or days does this seem to happen?
- What frameworks or libraries are you loading?

Any other information you can provide would be helpful.

--
Ikai Lan
Developer Programs Engineer, Google 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.


--
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] java.io.FilePermission on GAE plugin for Eclipse

2010-01-28 Thread jaljal
Hi,

I'm using the GAE plugin of Eclipse. I tried to open my jsf page, but
I had that stacktrace :

27 janv. 2010 22:41:50 javax.faces.webapp._ErrorPageWriter
handleThrowable
GRAVE: An exception occurred
java.security.AccessControlException: access denied
(java.io.FilePermission C:\Documents%20and%20Settings\morsi\workspace
\sample\war\WEB-INF\faces-config.xml read)
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at com.google.appengine.tools.development.DevAppServerFactory
$CustomSecurityManager.checkPermission(DevAppServerFactory.java:151)
at java.lang.SecurityManager.checkRead(Unknown Source)
at java.io.File.lastModified(Unknown Source)
at org.apache.myfaces.config.FacesConfigurator.getResourceLastModified
(FacesConfigurator.java:147)
at org.apache.myfaces.config.FacesConfigurator.getResourceLastModified
(FacesConfigurator.java:128)
at org.apache.myfaces.config.FacesConfigurator.getLastModifiedTime
(FacesConfigurator.java:202)
at org.apache.myfaces.config.FacesConfigurator.update
(FacesConfigurator.java:226)
at org.apache.myfaces.lifecycle.LifecycleImpl.execute
(LifecycleImpl.java:76)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:143)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:
487)


How can I resolve that permission problem ?

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] Fetch groups

2010-01-28 Thread KasperDK
I'm planning to use fetch groups in my java-app hosted on google app
engine. I can't seem to find much about fetch groups in the java app
engine documentation, so my question is if google app engine has
implemented fetch groups as defined in JSR-000243 Java Data Objects
2.2 Maintenance Release 2 ? If not, then where can I read a spec about
this issue ?

Also, please point me to document(s) / blog(s) containing the
technical road map for the GAE.

Cheers,

:-) Kasper

-- 
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] Fetch groups

2010-01-28 Thread Kasper Hansen
I'm planning to use fetch groups in my java-app hosted on google app
engine. I can't seem to find much about fetch groups in the java app
engine documentation, so my question is if google app engine has
implemented fetch groups as defined in JSR-000243 Java Data Objects
2.2 Maintenance Release 2 ?

Also, please point me to document(s) / blog(s) containing the
technical road map for the GAE.

Cheers,

:-) Kasper

-- 
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: Fetch groups

2010-01-28 Thread datanucleus
> if google app engine has implemented fetch groups as defined in JSR-000243 
> Java Data Objects
> 2.2 Maintenance Release 2 ?

GAE/J uses DataNucleus for the core persistence layer (and GAE/J
providing the layer communicating with the datastore), and DataNucleus
is the "reference implementation" for JDO 2.0, 2.1, 2.2, 2.3, so yes
has implemented that functionality, as per
http://www.datanucleus.org/products/accessplatform_2_0/jdo/fetchgroup.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: Merge join on list properties / more efficient on one list or on separate lists

2010-01-28 Thread Max
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 a lot,

Max

On 1月28日, 上午1時06分, Raphael André Bauer 
wrote:
> Hi everybody,
>
> Suppose you have to entities. Entity1 has one list, Entity2 has two lists:
>
> Entity1
> List tags_and_timestamps
>
> Entity2
> List tags
> List 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.



Re: [appengine-java] Updating an owned One-To-One relationship (JDO)

2010-01-28 Thread Robert Munro
i had a similar problem, I had to force a commit by closing the persistence
manager after changing the child objects info and before acessing the child
object via the parents field, it seems it gets refreshed when accessing it
via the parent.

On Wed, Jan 27, 2010 at 8:24 AM, Nick Wiedenbrueck <
nick.wiedenbru...@googlemail.com> wrote:

> My model has an owned one-to-one relationship just like in the
> Employee ContactInfo example. I can create the owning instance
> (Employee) with a ContactInfo, but my problem is, that I cannot update
> it afterwards. There is no exception, but the employee's contactInfo
> will remain the old one. Yet, when I have a look at the datastore, the
> new contact info is there.
>
> I can imagine, why this is: there are two distinct entities in the
> datastore, one for employee, and one for the contact infos. The
> relationship is made up by the key of ContactInfo, which contains the
> key of the owning employee. Now, when there is more than one contact
> info entity for an employee, how should the data store know which one
> to take for the employee?
>
> Anybody having the same problem, or am I missing anything?
>
> Regards,
> Nick
>
> --
> 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] Re: Updating an owned One-To-One relationship (JDO)

2010-01-28 Thread Nick Wiedenbrueck
Thanks for the answer, Robert.

> it seems it gets refreshed when accessing it via the parent.

I didn't have that experience. When I first update the child (by
setting it to a newly created instance) and access it then within the
same PM, I get the updated value. But If I load it next time, it would
have the old value again.

Also, I can't imagine how the reference is made up in the datastore.
When setting the child to a new value, there are two child entities in
the datastore, which both reference the same parent. The parent has no
reference to it's actual child. So how should the datastore decide,
which of the child entities is the correct one.

-- 
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] Incorrect number of entities returned

2010-01-28 Thread aswath satrasala
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);
List results = (List) 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] Unsupported method while parsing expression:

2010-01-28 Thread Ftaylor
Code:

Class Page {

List aliases;

...

query = pm.newQuery(Page.class);
query.setFilter(":aliases.contains(alias)");
query.declareVariables("String alias");
List results = (List)query.execute(alias);

...

}

I want to select Page objects where the aliases property contains a
given alias String value. Is there any way to do this? I tried as
above and got an exception:

Problem with query : Unsupported method  while
parsing expression: InvokeExpression{[ParameterExpression
{aliases}].contains(VariableExpression{alias})}

If this cannot be done with JDOQL, the only solution I can think of is
selecting every Page object, then looping through them and using
Java's contains method, but this sucks somewhat.

Anyone?

Cheers,

Finbarr

-- 
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: User authentication

2010-01-28 Thread Brian
Is there any documentation on how to combine app engine, openID, and
oauth?

We have already set up our production app (serving over 100K users) to
act as a shibboleth service provider, but would like to move it to app
engine. We need a way to provide the same federated authentication
support though. The app engine docs online only discuss google
accounts but they mention openID and oauth here and there. No real
directions.

We would be happy to work with you and google to document the process.
Our time frame for doing this in production is now.

On Jan 28, 2:02 am, Vinay  wrote:
> I would consider looking into the Federated Login API and leveraging
> OpenId to authenticate your users. You can use oAuth to access the
> user's data. If you're using Java, you can reference the step2
> project, which combines OpenId+oAuth. With this, you would have a
> single instance of your app,  and you would manage the authentication
> within the application.  You would also be responsible for making sure
> that the user data stays separated, as necessary since all domains
> that use the will share the same datastore.
>
> Links:http://groups.google.com/group/google-federated-login-apihttp://code.google.com/p/step2/
>
> On Jan 27, 3:53 pm, Sreeja Gautam  wrote:
>
>
>
> > Hi,
> > Am new to GAE. I want to build an application on GAE that stores data from
> > multiple companies. I would like to get advice on what would be the best
> > approach ..
> > 1) To host the application in different domains - one for each company?
> > 2) to host the application in one domain and use the
> > authentication/authorization provided in GAE to show the relevant data to
> > the users? A gmail account may not have company information for a person..
> > 3) build the authentication/authorization mechanism into my application?
> > Kindly advice.
> > Thanks!
> > Sree

-- 
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: Updating an owned One-To-One relationship (JDO)

2010-01-28 Thread Robert Munro
is the existing child object null in the parent? otherwise try modifying the
child object that you get from the parent?
and do you have the mappedBy property set in the parents annotation?

On Thu, Jan 28, 2010 at 11:05 AM, Nick Wiedenbrueck <
nick.wiedenbru...@googlemail.com> wrote:

> Thanks for the answer, Robert.
>
> > it seems it gets refreshed when accessing it via the parent.
>
> I didn't have that experience. When I first update the child (by
> setting it to a newly created instance) and access it then within the
> same PM, I get the updated value. But If I load it next time, it would
> have the old value again.
>
> Also, I can't imagine how the reference is made up in the datastore.
> When setting the child to a new value, there are two child entities in
> the datastore, which both reference the same parent. The parent has no
> reference to it's actual child. So how should the datastore decide,
> which of the child entities is the correct one.
>
> --
> 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] Re: Updating an owned One-To-One relationship (JDO)

2010-01-28 Thread Nick Wiedenbrueck
Here is what I'm doing:

employee.setContactInfor(new ContactInfo(...))
// in another request
employee.setContactInfor(new ContactInfo(...))
// in yet another request, this would give me the first ContactInfo
employee.getContactInfo()


> is the existing child object null in the parent?
What do you mean by that?

> and do you have the mappedBy property set in the parents annotation?
No, it's uni-directional, but would that make a difference? And I'm
worried, that there's no reference to the child on the owning side.

> otherwise try modifying the child object that you get from the parent?
I could try that.


Still, if anything of the above would work, I'd still expect a one-to-
one relationship to work in a different way.

Thanks a lot.

-- 
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: One-to-many querying for a child instance

2010-01-28 Thread Sydney
I followed the documentation on Keys:
http://code.google.com/appengine/docs/java/datastore/creatinggettinganddeletingdata.html#Keys
>From my understanding the annotation is used to tell the datastore to
use the name property to generate the key if it's populated. Maybe I
misinterpreted the documentation.

On Jan 27, 11:47 pm, Rusty Wright  wrote:
> Yes, as you can surmise, I'm guessing.
>
> What's this annotation on the name property for?
>
> @Extension(vendorName="datanucleus", key="gae.pk-name", value="true")
>
>
>
>
>
> Sydneywrote:
> > Since I declared the parameter with query.declareParameters("String
> > nameParam");, the colon is not valid. As expected I got an exception
> > org.datanucleus.store.query.QueryCompilerSyntaxException: Explicit
> > parameters defined for query, yet implicit parameter syntax
> > (":nameParam") found
>
> > On Jan 27, 4:39 pm, Rusty Wright  wrote:
> >> Do you need a colon in front of nameParam?
>
> >>             query.setFilter("name == :nameParam");
>
> >> Sydneywrote:
> >>> The query returns no result.
> >>>             ApiProxy.setEnvironmentForCurrentThread(new TestEnvironment
> >>> ());
> >>>             ApiProxy.setDelegate(new ApiProxyLocalImpl(new File("."))
> >>> {
> >>>             });
> >>>             A a = new A("A");
> >>>             B b = new B("B");
> >>>             a.getBs().add(b);
> >>>             PersistenceManagerFactory pmf =
> >>> JDOHelper.getPersistenceManagerFactory("transactions-optional");
> >>>             PersistenceManager pm = pmf.getPersistenceManager();
> >>>             Transaction tx = pm.currentTransaction();
> >>>             try {
> >>>                 tx.begin();
> >>>                 pm.makePersistent(a);
> >>>                 tx.commit();
> >>>             } finally {
> >>>                 if (tx.isActive()) {
> >>>                     tx.rollback();
> >>>                 }
> >>>             }
> >>>             System.out.println(a.getKey());
> >>>             A ap = pm.getObjectById(A.class, "A");
> >>>             System.out.println(ap.getKey());
> >>>             Query query = pm.newQuery(B.class);
> >>>             query.setFilter("name == nameParam");
> >>>             query.declareParameters("String nameParam");
> >>>             List rs = (List) query.execute("B");
> >>>             System.out.println(rs.size());
> >>> On Jan 23, 12:20 am, John Patterson  wrote:
>  Execute a query on the name property of B rather than loading it by  
>  key.  If the name is unique the result should only contain one B.
>  On 23 Jan 2010, at 11:41,Sydneywrote:
> > I have a one to many relationship. There is a problem in the way I
> > query for a B object. I was wondering what is the best way (most
> > efficient) to do that.
> > A a = new A("A");
> > B b = new B("B");
> > a.getBs().add(b);
> > pm.makePersistent(a); // it's done inside a transaction
> > A ap = pm.getObjectById(A.class, "A"); // FINE
> > B bp = pm.getObjectById(B.class, "B"); // NOT FOUND Exception
> > I guess B is not found because the real key is not B but B + A key.
> > How do you get the B object when you don't know nothing about A?
> > public class A {
> >   �...@primarykey
> >   �...@persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
> >   �...@extension(vendorName = "datanucleus", key = "gae.encoded-pk",
> > value = "true")
> >    private String key;
> >   �...@persistent
> >   �...@extension(vendorName = "datanucleus", key = "gae.pk-name", value
> > = "true")
> >    private String name;
> >   �...@persistent(mappedBy = "a")
> >    private List bs;
> >    public A(String name) {
> >        this.name = name;
> >        bs = new ArrayList();
> >    }
> > ... Getter/Setter
> > }
> > @PersistenceCapable(identityType =
> > javax.jdo.annotations.IdentityType.APPLICATION)
> > public class B {
> >   �...@primarykey
> >   �...@persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
> >   �...@extension(vendorName = "datanucleus", key = "gae.encoded-pk",
> > value = "true")
> >    private String key;
> >   �...@persistent
> >   �...@extension(vendorName = "datanucleus", key = "gae.pk-name", value
> > = "true")
> >    private String name;
> >   �...@persistent
> >    private A a;
> >    public B(String name) {
> >        this.name = name;
> >    }
> > ... Getter/Setter
> > }
> > --
> > 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
> > .
>
> --
> 0x2B | ~0

[appengine-java] Re: 30 seconds

2010-01-28 Thread elwis
Hi, yes http://camel.apache.org/ is the thing.

It's a routing engine, you get input, examines it and send it to the
correct user.
That's the simplest flow, usually you do some enrichment and
transformation also.

Regards
Stefan


On 27 Jan, 22:29, "Ikai L (Google)"  wrote:
> What's Camel? This is the only thing I was able to find on Google:
>
> http://camel.apache.org/python.html
>
>
>
>
>
> On Tue, Jan 26, 2010 at 9:40 PM, elwis  wrote:
> > Hi all,
>
> > I'm playing around with the Appengine and thought about using it as an
> > integration platform with Camel in the middle. However, one thing
> > concerns me.
>
> > If I'm right, my integration flow will need to be finished during this
> > 30s that's mentioned or be killed off?
> > 30s might not be enough if there are a lot of traffic and advanced
> > conversions between formats.
>
> > Regards
> > Stefan
>
> > --
> > 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 > 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] How can I install my GAE application into other user accounts?

2010-01-28 Thread mjustin
Hello,

is there a way to copy my GAE application into somebody elses account?

I would like to make it as easy as possible for the recipient, so he/
she should not need the GAE SDK installed.

I have seen that there is a way to invite a Developer to Collaborate
on an Application.

So my idea is

* the recipient creates a new application and then invites me as a
developer
* I can upload the app to his/her account

Is this possible?

Many thanks in advance,

Michael

-- 
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] Retrieve User object by UserId string

2010-01-28 Thread Grégoire Galinand
Hi,

I store on the datastore the UserId (who is a String that i get with
the method User.getUserID()) and I want to retrieve the Object User
corresponding to this UserId to get his EmailAddress.


Is it possible to do ?


Thanks


Grégoire

-- 
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] Retrieve User object by UserId string

2010-01-28 Thread Don Schwarz
Why not just store the User object in the datastore property directly?

2010/1/28 Grégoire Galinand :
> Hi,
>
> I store on the datastore the UserId (who is a String that i get with
> the method User.getUserID()) and I want to retrieve the Object User
> corresponding to this UserId to get his EmailAddress.
>
>
> Is it possible to do ?
>
>
> Thanks
>
>
> Grégoire
>
> --
> 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] Mail message dispatch from the web.xml

2010-01-28 Thread Dom Derrien
I've problems setting up specific servlets to respond to mail
messages...

I've followed the directions given at 
http://code.google.com/appengine/docs/java/mail/receiving.html
to setup a series of three filters:
- /_ah/mail/maezel* => MailResponder
- /_ah/mail/twitter* => TwitterResponder
- /_ah/mail/* => CatchAllHandler

Messages sent to addresses matching the first filter are correctly
forwarded.
Messages sent to addresses matching the second filter are always
forwarded to the CatchAllHandler!

I've tried to specify the full email addresses (like:
mae...@test.appspotmail.com) but then everything go to the
CatchAllHandler.

Is it possible the star (*) filter only works after a slash (/)?

As a work-around, I can forward everything to the CatchAllHandler and
do there a manual dispatch by checking the content of the
request.getPathInfo(). However, this is not nice and I want to
understand the issue root cause!

Any idea?

A+, Dom

-- 
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] How can I install my GAE application into other user accounts?

2010-01-28 Thread Ikai L (Google)
You should just be able to change the application ID in application-web.xml
and push it.

On Thu, Jan 28, 2010 at 8:23 AM, mjustin  wrote:

> Hello,
>
> is there a way to copy my GAE application into somebody elses account?
>
> I would like to make it as easy as possible for the recipient, so he/
> she should not need the GAE SDK installed.
>
> I have seen that there is a way to invite a Developer to Collaborate
> on an Application.
>
> So my idea is
>
> * the recipient creates a new application and then invites me as a
> developer
> * I can upload the app to his/her account
>
> Is this possible?
>
> Many thanks in advance,
>
> Michael
>
> --
> 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.
>
>


-- 
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] Webservice on Google App Engine

2010-01-28 Thread Pravesh
Hi Friends,

Can anyone tell me the way I can create a webservice and deploy on
google app engine. Actually my requirement is to access the data from
the google data source using the JDO Api's and and expose it using a
webservice.

I am trying to create a 3rd party integration solution in which I want
to expose google data store data to a 3rd party solution, which can
consume the webservice and can fetch the data from the google data
store.

If you guys have any other idea of accessing the data from google
store apart from using a webservice then please let me know. Lets
discuss the feasibility.

NOTE: Just a small request. This is quite urgent and I need to get
some solution before 2nd Feb' 2010. So please pour in your ideas ASAP.

Thanks and Regards,
Pravesh

-- 
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: Fetch groups

2010-01-28 Thread Jeff Schnitzer
Keep in mind that fetch groups don't actually work the way you think
they do.  You don't get any efficiency from excluding basic properties
from fetching because Appengine always fetches the full content of
every entity.

Relationship fetch groups, on the other hand, probably work closer to
the way you would expect.

Jeff

On Thu, Jan 28, 2010 at 12:44 AM, datanucleus  wrote:
>> if google app engine has implemented fetch groups as defined in JSR-000243 
>> Java Data Objects
>> 2.2 Maintenance Release 2 ?
>
> GAE/J uses DataNucleus for the core persistence layer (and GAE/J
> providing the layer communicating with the datastore), and DataNucleus
> is the "reference implementation" for JDO 2.0, 2.1, 2.2, 2.3, so yes
> has implemented that functionality, as per
> http://www.datanucleus.org/products/accessplatform_2_0/jdo/fetchgroup.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.



Re: [appengine-java] Webservice on Google App Engine

2010-01-28 Thread Jeff Schnitzer
The easiest way to publish a web service (interpreted as "an
http-based rpc protocol") is with Hessian.  The 4.0.3 version of
Caucho's hessian jar should work fine as both client and server on
Appengine.

Other solutions (JAX-RS, SOAP) are available but they are all a lot
more complicated.  With Hessian you make a java interface, implement
the interface, and you're pretty much done.  It's easy to make
equivalent interfaces on many non-Java platforms.

Jeff

On Thu, Jan 28, 2010 at 10:59 AM, Pravesh  wrote:
> Hi Friends,
>
> Can anyone tell me the way I can create a webservice and deploy on
> google app engine. Actually my requirement is to access the data from
> the google data source using the JDO Api's and and expose it using a
> webservice.
>
> I am trying to create a 3rd party integration solution in which I want
> to expose google data store data to a 3rd party solution, which can
> consume the webservice and can fetch the data from the google data
> store.
>
> If you guys have any other idea of accessing the data from google
> store apart from using a webservice then please let me know. Lets
> discuss the feasibility.
>
> NOTE: Just a small request. This is quite urgent and I need to get
> some solution before 2nd Feb' 2010. So please pour in your ideas ASAP.
>
> Thanks and Regards,
> Pravesh
>
> --
> 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] Re: Mail message dispatch from the web.xml

2010-01-28 Thread Dom Derrien
Little update:
- In fact specifying the full email addresses after the /_ah/mail/
prefix works!
- I was fooled by the empty path info :(
- It seems to me the given example has not been tested ;)

Note that there's a typo in the example given at
http://code.google.com/appengine/docs/java/mail/receiving.html: 2
mapping definitions have the same name “handleowner”.

A+, Dom
--
On Jan 28, 1:39 pm, Dom Derrien  wrote:
> I've problems setting up specific servlets to respond to mail
> messages...
>
> I've followed the directions given at 
> http://code.google.com/appengine/docs/java/mail/receiving.html
> to setup a series of three filters:
> - /_ah/mail/maezel* => MailResponder
> - /_ah/mail/twitter* => TwitterResponder
> - /_ah/mail/* => CatchAllHandler
>
> Messages sent to addresses matching the first filter are correctly
> forwarded.
> Messages sent to addresses matching the second filter are always
> forwarded to the CatchAllHandler!
>
> I've tried to specify the full email addresses (like:
> mae...@test.appspotmail.com) but then everything go to the
> CatchAllHandler.
>
> Is it possible the star (*) filter only works after a slash (/)?
>
> As a work-around, I can forward everything to the CatchAllHandler and
> do there a manual dispatch by checking the content of the
> request.getPathInfo(). However, this is not nice and I want to
> understand the issue root cause!
>
> Any idea?
>
> A+, Dom

-- 
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: jaxb-impl version?

2010-01-28 Thread Iqbal Yusuf Dipu
I'm kind of in the same boat. May we know which version of JAX-B
implementation is being supported in App Engine?

Thanks.

IY

-- 
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] Question about server side security

2010-01-28 Thread Ikai L (Google)
Hi there,

>From this page:

http://code.google.com/apis/apps/profiles/developers_guide_protocol.html

It
looks like it's possible to use AuthSub or OAuth, which would preclude you
from having to store a username and password. Granted, with an OAuth token,
it'd be possible to make API calls if *that* data is compromised, but it
prevents you from having to expose password information. There are two main
security advantages of using OAuth:

- Access can be revoked without having to change a password, though I am not
sure off the team of my head where this is done. You'll want to ask on the
GData groups.
- If the token is compromised, the password is not compromised. That is - a
user will be able to use the administrative token to continue to make
profile API calls until it is revoked, but they will not be able to log into
your account dashboard in other parts of Google Apps that use the same
username and password.


On Wed, Jan 27, 2010 at 11:25 AM, NMAGOCIO  wrote:

> I would like to develop an App that lets my Google Apps domain users
> update their phone numbers for their domain Profiles.
> My problem is that only a domain admin can access the Profiles API.
> The flow would go something like: user signs in by GAE Apps domain
> user service. On load RPC transfers user name to servlet which uses
> Profiles API and hard coded domain admin account to pull user phone
> numbers.
>
> It does not do much so there is not alot of risk except the domain
> admin account credentials stored on the server side. That should not
> be accessible but I am concerned. Any ideas on a better way to do this
> or maybe there is no reason for concern?
>
> --
> 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.
>
>


-- 
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] Re: jaxb-impl version?

2010-01-28 Thread Don Schwarz
What happens when you include the version of JAXB that you want to
use?  Please include a stack trace and some explanation of how your
application is configured.

On Thu, Jan 28, 2010 at 4:10 PM, Iqbal Yusuf Dipu
 wrote:
> I'm kind of in the same boat. May we know which version of JAX-B
> implementation is being supported in App Engine?
>
> Thanks.
>
> IY
>
> --
> 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] Re: SocialWok.com presentation qusetion on workaround on "join"

2010-01-28 Thread Ikai L (Google)
Can you summarize the technique used?

As far as "join table" goes, App Engine's datastore isn't relational.
Filtered queries will work differently and were built with scalability
characteristics in mind. Sometimes these characteristics will overlap with
functionality that SQL provides and may even produce similar looking GQL,
but at some level, it'll be different. Our goal is to make as much of the
Google infrastructure as we can available for developers. The datastore is
built on top of BigTable, which is itself not relational. Rather than think
of your data in terms of SQL schema, it'd be advantageous to think of how
you would store data in a key/value store - this is really the secret to
success. If you have a chance, watch our Google I/O presentations from last
year:

http://sites.google.com/site/io/

Here's one example of how certain problems are solved using App Engine's
datastore:

http://sites.google.com/site/io/building-scalable-web-applications-with-google-app-engine

Here's
a good video describing how the datastore works underneath the hood:
http://sites.google.com/site/io/under-the-covers-of-the-google-app-engine-datastore

You'll want to watch these and read some of the articles we've published
when you start needing to doing more complex queries:
http://code.google.com/appengine/articles/

In the end, it's all about how you structure your data. Traditional RDBMS
emphasizes normalization. We do not. App Engine emphasizes denormalization,
favoring precalculated results for low latency responses to user requests.

On Wed, Jan 27, 2010 at 6:24 PM, asianCoolz  wrote:

> sure. the link is
> http://groups.google.com/group/google-appengine-java/browse_thread/thread/b9e6a61357c4445d
>
> Ikai,  can give any tips what roadmap JGAE plan to improve on
> datastore? is that no way in the future to do "join table" ? and have
> to use this technique?
>
> --
> 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.
>
>


-- 
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: Local datastore lost after deployment

2010-01-28 Thread captain
Thank you John!

On Jan 26, 12:59 am, John Patterson  wrote:
> The local datastore does not get deployed to the app engine servers.  
> That would be a cool feature though!
>
> But deploying an app will not modify your local datastore.  However, I  
> have occasionally had my local datastore just reset itself without  
> warning.  Basically the local sdk is for development and testing only.
>
> On 26 Jan 2010, at 13:55, captain wrote:
>
>
>
> > Hi All,
>
> > I'm using the eclipse plug-in and all was good until I deployed my
> > app.
>
> > My deployed app in the cloud didn't deploy along with the datastore
> > records I created during development for months. And worse, all my
> > local data classes suddenly are empty too.
>
> > Any idea of what I did wrong?
>
> > Thanks
> > Claudio
>
> > --
> > 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
> > .- Hide quoted text -
>
> - Show quoted text -

-- 
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] Questions about JDO/JPA versioning

2010-01-28 Thread Ikai L (Google)
1. No, the parent will not be updated. You are updating a Child - not a
parent. However - you will want to be very careful with Child entities in a
Collection. I believe there is an outstanding issues where if you only
update the Child entity, the Parent entity will not know the Collection has
changed and will not be persisted:
http://groups.google.com/group/google-appengine-java/browse_thread/thread/152cdafdded18611/f91dc4c6a477b8d8?show_docid=f91dc4c6a477b8d8

2.
No, this will throw an IllegalArgumentException:

java.lang.
IllegalArgumentException: OPT_VERSION: java.sql.Timestamp is not a
supported property type.

If you need this functionality, please open an issue in our issue tracker:

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

For the purposes of optimistic locking, I'm not sure I see the benefit of
using this anyway - as a developer, you do not care what lock mechanism is
being implemented. If you require an "updated" timestamp, you should use the
preUpdate hook instead, since using a DATE_TIME version will cause every one
of your updates to pay the cost of an additional transactional get before
you save.

3. I'm not familiar with the behavior here. Can you describe what the
expected behavior should be? If you can write a test case that either
demonstrates this or contradicts what is expected it would be extremely
helpful.

On Tue, Jan 19, 2010 at 12:08 AM, Brandon  wrote:

> Hi,
>
> Consider an example where class A has a "child" property of class B,
> and B has a property "title", as follows:
>
> @PersistenceCapable
> @Version(... field-name="version")
> Class A {
>protected long version;
>
>@Persistent
>protected B child;
>
>
> }
>
> @PersistenceCapable
> Class B {
>@Persistent
>protected String title;
>
>public void setTitle(String title) {...}
>
>
> }
>
> tx.begin();
> // get an instance of Class A
> A parent = ...;
> parent.child.setTitle("foo");
> pm.makePersistent(parent);
> tx.commit();
>
>
> Question1: Will the version of "parent" be increased in this case
> (when all its property values are not changed directly)?
>
> Question2: Does appengine support the VersionStrategy.DATE_TIME
> attribute in @Version?
>
> Question3: Given that A is annotated with @Version and the version
> field is protected, should a subclass of A needs to be annotated with
> @Version too in order to have the version managed by JDO/JPA?
>
> Sorry in advance if these questions appear somewhere else.
>
> --
> 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.
>
>
>
>


-- 
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] Are java.lang.String properties on an entity limited to 500 chars or 500 bytes (which may be 250 chars depending on encoding). Please clarify.

2010-01-28 Thread Ugorji

http://code.google.com/appengine/docs/java/javadoc/com/google/appengine/api/datastore/Text.html
It says here that String properties are limited to 500 characters.

http://code.google.com/appengine/docs/java/datastore/dataclasses.html#Core_Value_Types
It says here that String properties are limited to 500 bytes, which
may end up being only 250 characters depending on the encoding.

I am using the low-level API. Is this just a discrepancy in the JDO
facade, or do I have to convert to Text object when storing if an
object is over 250 characters (to be safe)?

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] Are java.lang.String properties on an entity limited to 500 chars or 500 bytes (which may be 250 chars depending on encoding). Please clarify.

2010-01-28 Thread Ikai L (Google)
It should be 500 characters. We need to fix the documentation:

http://code.google.com/p/googleappengine/issues/detail?id=2519

On Thu, Jan 28, 2010 at 4:19 PM, Ugorji  wrote:

>
>
> http://code.google.com/appengine/docs/java/javadoc/com/google/appengine/api/datastore/Text.html
> It says here that String properties are limited to 500 characters.
>
>
> http://code.google.com/appengine/docs/java/datastore/dataclasses.html#Core_Value_Types
> It says here that String properties are limited to 500 bytes, which
> may end up being only 250 characters depending on the encoding.
>
> I am using the low-level API. Is this just a discrepancy in the JDO
> facade, or do I have to convert to Text object when storing if an
> object is over 250 characters (to be safe)?
>
> 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.
>
>


-- 
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] Rules for creating multiple child entities at the same time

2010-01-28 Thread Ugorji
I want to put some entities in the same entity group as a parent. If
multiple users try to create child entities at the same time, will
their put requests all lock on the parent entity and get executed in
sequence (even though I am not making any changes to the parent? and
the parent does not hold references to the children). I would hope
not, but want some clarity on this.

If their put requests get run one at a time, will I have to
continually retry? I read somewhere that App Engine automatically
retries non-transactional requests on failures. However, I then read
here that we should retry our requests as is typical where optimistic
concurrency is used.
http://code.google.com/appengine/docs/java/datastore/transactions.html#What_Can_Be_Done_In_a_Transaction

What are the rules on when a retry is needed? Are they needed anytime
I try to create a child entity without affecting the parent?

-- 
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: Rules for creating multiple child entities at the same time

2010-01-28 Thread Enrique Perez

My understanding is that all writes within the same entity group are
serialized. Hence a best practice is keep Entity Groups as small as
possible. If there is contention between two simulatanous writes to
the same Entity Group, one fails, and having retry logic here will
help get that second write to succeed  In my experience a high
percentage of write retries succeed on 2nd or 3rd retry  Hopefully
this helps...

Thanks
Enrique Perez
Austin, Texas

On Jan 28, 6:47 pm, Ugorji  wrote:
> I want to put some entities in the same entity group as a parent. If
> multiple users try to create child entities at the same time, will
> their put requests all lock on the parent entity and get executed in
> sequence (even though I am not making any changes to the parent? and
> the parent does not hold references to the children). I would hope
> not, but want some clarity on this.
>
> If their put requests get run one at a time, will I have to
> continually retry? I read somewhere that App Engine automatically
> retries non-transactional requests on failures. However, I then read
> here that we should retry our requests as is typical where optimistic
> concurrency is 
> used.http://code.google.com/appengine/docs/java/datastore/transactions.htm...
>
> What are the rules on when a retry is needed? Are they needed anytime
> I try to create a child entity without affecting the parent?

-- 
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: How do you get a generated ID value of an persistent object in JDO using datanucleus rdbms?

2010-01-28 Thread ivanceras
Okay, I have found my answer. You have to persiste the object first
before you could get its generated primary field value. Cheers!

On Jan 28, 4:07 pm, ivanceras  wrote:
> When you instanciate a persisten object in google app engine the
> object automatically is assigned with a value to its primary field
> even before persisting it in the database.
>
> sample class:
> MyClass{
> @PrimaryKey @Persistent(valueStrategy=IdGeneratorStrategy.IDENTITY)
> private Long id;
>
> }
>
> But in the case with rdbms, the primary field is not assigned with a
> value. Its value is created when the persistent object is saved into
> the database. But I need to use the value of its primary field before
> persisting it. What is the proper way to do this, in a sense it would
> also work using any other underlying supported datasource?

-- 
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: SocialWok.com presentation qusetion on workaround on "join"

2010-01-28 Thread asianCoolz
i will try.  The reason socialwork suggested to use code snippet above
is because bigtable doesnt support join. by using this technique they
claim overhead will be smaller.

-- 
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: Rules for creating multiple child entities at the same time

2010-01-28 Thread Ugorji
Thanks Enrique for your response.

This seems to be what the app engine docs are alluding to, but they
are not specific on the writes when the parent entity is not part of
the transaction, and furthermore they suggest that optimistic
concurrency is used and not locking, which lends credence that if the
parent is not involved and just new entities are being created, there
should be no contention. I've watched some of the Google IO videos
also, and they seem to suggest that, but are not specific.

http://code.google.com/appengine/docs/whatisgoogleappengine.html

Looking at the link above, under the title "The Datastore", and I
quote:

  "An update of a entity occurs in a transaction that is retried a
fixed number of times if other processes are trying to update the same
entity simultaneously."

This suggests that optimistic concurrency only applies if multiple
processes are trying to update the *same* entity simultaneously.
Optimistic concurrency also *implies* that first one wins.

In my case, they are not trying to update the same entity, so it
shouldn't matter.

It seems the app engine docs are not clear on this, and I really want
to leverage the entity groups in this way. Maybe one of the Google
guys can help clarify this?


On Jan 28, 4:56 pm, Enrique Perez  wrote:
> My understanding is that all writes within the same entity group are
> serialized. Hence a best practice is keep Entity Groups as small as
> possible. If there is contention between two simulatanous writes to
> the same Entity Group, one fails, and having retry logic here will
> help get that second write to succeed  In my experience a high
> percentage of write retries succeed on 2nd or 3rd retry  Hopefully
> this helps...
>
> Thanks
> Enrique Perez
> Austin, Texas
>
> On Jan 28, 6:47 pm, Ugorji  wrote:
>
>
>
> > I want to put some entities in the same entity group as a parent. If
> > multiple users try to create child entities at the same time, will
> > their put requests all lock on the parent entity and get executed in
> > sequence (even though I am not making any changes to the parent? and
> > the parent does not hold references to the children). I would hope
> > not, but want some clarity on this.
>
> > If their put requests get run one at a time, will I have to
> > continually retry? I read somewhere that App Engine automatically
> > retries non-transactional requests on failures. However, I then read
> > here that we should retry our requests as is typical where optimistic
> > concurrency is 
> > used.http://code.google.com/appengine/docs/java/datastore/transactions.htm...
>
> > What are the rules on when a retry is needed? Are they needed anytime
> > I try to create a child entity without affecting the parent?

-- 
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: Rules for creating multiple child entities at the same time

2010-01-28 Thread Ugorji
I think I found half of an answer here:

http://bolour.com/blog/2009/06/the-google-app-engine-data-model/

Quoting:

  "GAE uses optimistic concurrency control for transactions, and its
concurrency control algorithm operates at the root level of an entity
group. The optimistic concurrency control timestamp of the root
reflects the last update time of any entity in the group. So large
entity groups increase the likelihood of timestamp conflicts and
resulting rollbacks."
  "Currently the data store cannot support more than about 10 writes
per entity group per second all told. So large entity groups reduce
parallelism between transactions since a transaction affecting any
entity in an entity group requires a write to the group’s root
entity."

This suggests that whenever a transaction is used to update a child
entity, a pseudo-lock on the entity root is used as a timestamp there
has to be written.

My question is thus: if I am not doing a put within a transaction,
will I still have to pay this price of serialized access? Can I safely
assume that I can bypass the optimistic concurrency lock by not using
transactions if I'm creating a child entity by itself?


On Jan 28, 5:11 pm, Ugorji  wrote:
> Thanks Enrique for your response.
>
> This seems to be what the app engine docs are alluding to, but they
> are not specific on the writes when the parent entity is not part of
> the transaction, and furthermore they suggest that optimistic
> concurrency is used and not locking, which lends credence that if the
> parent is not involved and just new entities are being created, there
> should be no contention. I've watched some of the Google IO videos
> also, and they seem to suggest that, but are not specific.
>
> http://code.google.com/appengine/docs/whatisgoogleappengine.html
>
> Looking at the link above, under the title "The Datastore", and I
> quote:
>
>   "An update of a entity occurs in a transaction that is retried a
> fixed number of times if other processes are trying to update the same
> entity simultaneously."
>
> This suggests that optimistic concurrency only applies if multiple
> processes are trying to update the *same* entity simultaneously.
> Optimistic concurrency also *implies* that first one wins.
>
> In my case, they are not trying to update the same entity, so it
> shouldn't matter.
>
> It seems the app engine docs are not clear on this, and I really want
> to leverage the entity groups in this way. Maybe one of the Google
> guys can help clarify this?
>
> On Jan 28, 4:56 pm, Enrique Perez  wrote:
>
>
>
> > My understanding is that all writes within the same entity group are
> > serialized. Hence a best practice is keep Entity Groups as small as
> > possible. If there is contention between two simulatanous writes to
> > the same Entity Group, one fails, and having retry logic here will
> > help get that second write to succeed  In my experience a high
> > percentage of write retries succeed on 2nd or 3rd retry  Hopefully
> > this helps...
>
> > Thanks
> > Enrique Perez
> > Austin, Texas
>
> > On Jan 28, 6:47 pm, Ugorji  wrote:
>
> > > I want to put some entities in the same entity group as a parent. If
> > > multiple users try to create child entities at the same time, will
> > > their put requests all lock on the parent entity and get executed in
> > > sequence (even though I am not making any changes to the parent? and
> > > the parent does not hold references to the children). I would hope
> > > not, but want some clarity on this.
>
> > > If their put requests get run one at a time, will I have to
> > > continually retry? I read somewhere that App Engine automatically
> > > retries non-transactional requests on failures. However, I then read
> > > here that we should retry our requests as is typical where optimistic
> > > concurrency is 
> > > used.http://code.google.com/appengine/docs/java/datastore/transactions.htm...
>
> > > What are the rules on when a retry is needed? Are they needed anytime
> > > I try to create a child entity without affecting the parent?

-- 
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: Rules for creating multiple child entities at the same time

2010-01-28 Thread Enrique Perez
Ugorji,

I agree with you that the documentation is not 100% clear.  In Google
I/O 2008, Under the Hood of AppEngine Datastore, Ryan Barrett
discusses transactions under the hood.  Toward the backend of the
video (about 40 minutes in),  he talked about how transactions are
implemented within the context of Entity Groups.  He discussed the
notion of a transaction log that lives at the root entity of the
Entity Group.  My understanding is that all transactional writes to an
Entity Group, even to children in the entity group, will use this one
transaction log during the transaction window.  Because of this you
can get write contention, even if you just writing to child entities.
This is my recollection after watching this video some months back...
I could be missing something..  If anyone has additional insight
please correct anything that may be wrong...

Thanks
Enrique Perez
Austin, Texas

On Jan 28, 7:11 pm, Ugorji  wrote:
> Thanks Enrique for your response.
>
> This seems to be what the app engine docs are alluding to, but they
> are not specific on the writes when the parent entity is not part of
> the transaction, and furthermore they suggest that optimistic
> concurrency is used and not locking, which lends credence that if the
> parent is not involved and just new entities are being created, there
> should be no contention. I've watched some of the Google IO videos
> also, and they seem to suggest that, but are not specific.
>
> http://code.google.com/appengine/docs/whatisgoogleappengine.html
>
> Looking at the link above, under the title "The Datastore", and I
> quote:
>
>   "An update of a entity occurs in a transaction that is retried a
> fixed number of times if other processes are trying to update the same
> entity simultaneously."
>
> This suggests that optimistic concurrency only applies if multiple
> processes are trying to update the *same* entity simultaneously.
> Optimistic concurrency also *implies* that first one wins.
>
> In my case, they are not trying to update the same entity, so it
> shouldn't matter.
>
> It seems the app engine docs are not clear on this, and I really want
> to leverage the entity groups in this way. Maybe one of the Google
> guys can help clarify this?
>
> On Jan 28, 4:56 pm, Enrique Perez  wrote:
>
>
>
> > My understanding is that all writes within the same entity group are
> > serialized. Hence a best practice is keep Entity Groups as small as
> > possible. If there is contention between two simulatanous writes to
> > the same Entity Group, one fails, and having retry logic here will
> > help get that second write to succeed  In my experience a high
> > percentage of write retries succeed on 2nd or 3rd retry  Hopefully
> > this helps...
>
> > Thanks
> > Enrique Perez
> > Austin, Texas
>
> > On Jan 28, 6:47 pm, Ugorji  wrote:
>
> > > I want to put some entities in the same entity group as a parent. If
> > > multiple users try to create child entities at the same time, will
> > > their put requests all lock on the parent entity and get executed in
> > > sequence (even though I am not making any changes to the parent? and
> > > the parent does not hold references to the children). I would hope
> > > not, but want some clarity on this.
>
> > > If their put requests get run one at a time, will I have to
> > > continually retry? I read somewhere that App Engine automatically
> > > retries non-transactional requests on failures. However, I then read
> > > here that we should retry our requests as is typical where optimistic
> > > concurrency is 
> > > used.http://code.google.com/appengine/docs/java/datastore/transactions.htm...
>
> > > What are the rules on when a retry is needed? Are they needed anytime
> > > I try to create a child entity without affecting the parent?- Hide quoted 
> > > text -
>
> - Show quoted text -

-- 
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] change timezone of date that is already persisted

2010-01-28 Thread mar_novice
Hi,
Is there a way to change the timezone of the whole app and also
change the timezone of the dates that were already in the datastore
from UTC to a specific timezone?

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: Using a Key in a query filter

2010-01-28 Thread Szymon Malok

Ok I removedquery.setRange(0,1);

error disappeared. Still sth is wrong but not with __key__

-- 
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: Using a Key in a query filter

2010-01-28 Thread Szymon Malok
Hi, I have the same problem with following code:

public static RService getOneService(String owner, String idService,
PersistenceManager pm)
{
List Services = new ArrayList();

Query query = pm.newQuery(RService.class);
query.setFilter("id==keyService && idOwner==keyOwner ");
query.declareParameters("String keyService,String keyOwner ");

query.setRange(0,1);

Services = (List) query.execute(idService,owner);

Iterator iterator = Services.iterator();
if ( iterator.hasNext() ) return iterator.next();
else return null;
}

running that method cause me:

java.lang.IllegalArgumentException: __key__ filter value must be a Key
at
com.google.appengine.api.datastore.DatastoreApiHelper.translateError
(DatastoreApiHelper.java:33)
at com.google.appengine.api.datastore.DatastoreApiHelper.makeSyncCall
(DatastoreApiHelper.java:60)
at com.google.appengine.api.datastore.DatastoreServiceImpl
$PreparedQueryImpl.runQuery(DatastoreServiceImpl.java:388)
at com.google.appengine.api.datastore.DatastoreServiceImpl
$PreparedQueryImpl.asQueryResultList(DatastoreServiceImpl.java:318)
at
org.datanucleus.store.appengine.query.DatastoreQuery.fulfillEntityQuery
(DatastoreQuery.java:355)
at org.datanucleus.store.appengine.query.DatastoreQuery.executeQuery
(DatastoreQuery.java:265)

.


id is an encoded string key, I am not using Key fields. I have other
simillar-designed classes and they are working fine with the same
query. Also above code was working as well two weeks ago

Any ideas / solution mates?

-- 
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] java ip to location library

2010-01-28 Thread Ikai L (Google)
There's another thread about this topic here:

http://groups.google.com/group/google-appengine/browse_thread/thread/ebebbacc69688925

Typically,
this won't exist in a library - it's just data. You'll need to find a source
and either cache the data or query it each time you need it.

On Wed, Jan 27, 2010 at 6:58 PM, Andrei  wrote:

> Is there a library i can use on GAE that will tell me country and
> probably state based on ip?
> 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.
>
>


-- 
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: Are java.lang.String properties on an entity limited to 500 chars or 500 bytes (which may be 250 chars depending on encoding). Please clarify.

2010-01-28 Thread Ugorji
Thanks much.

On Jan 28, 4:36 pm, "Ikai L (Google)"  wrote:
> It should be 500 characters. We need to fix the documentation:
>
> http://code.google.com/p/googleappengine/issues/detail?id=2519
>
>
>
>
>
> On Thu, Jan 28, 2010 at 4:19 PM, Ugorji  wrote:
>
> >http://code.google.com/appengine/docs/java/javadoc/com/google/appengi...
> > It says here that String properties are limited to 500 characters.
>
> >http://code.google.com/appengine/docs/java/datastore/dataclasses.html...
> > It says here that String properties are limited to 500 bytes, which
> > may end up being only 250 characters depending on the encoding.
>
> > I am using the low-level API. Is this just a discrepancy in the JDO
> > facade, or do I have to convert to Text object when storing if an
> > object is over 250 characters (to be safe)?
>
> > 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 > 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: Rules for creating multiple child entities at the same time

2010-01-28 Thread Ugorji
Thanks Enrique for your responses. I've done more research and it
seems that
- every write is serialized (regardless of within tx or not)
- contention will always exist at the Entity Group
- use retries to manage

On Jan 28, 5:28 pm, Enrique Perez  wrote:
> Ugorji,
>
> I agree with you that the documentation is not 100% clear.  In Google
> I/O 2008, Under the Hood of AppEngine Datastore, Ryan Barrett
> discusses transactions under the hood.  Toward the backend of the
> video (about 40 minutes in),  he talked about how transactions are
> implemented within the context of Entity Groups.  He discussed the
> notion of a transaction log that lives at the root entity of the
> Entity Group.  My understanding is that all transactional writes to an
> Entity Group, even to children in the entity group, will use this one
> transaction log during the transaction window.  Because of this you
> can get write contention, even if you just writing to child entities.
> This is my recollection after watching this video some months back...
> I could be missing something..  If anyone has additional insight
> please correct anything that may be wrong...
>
> Thanks
> Enrique Perez
> Austin, Texas
>
> On Jan 28, 7:11 pm, Ugorji  wrote:
>
>
>
> > Thanks Enrique for your response.
>
> > This seems to be what the app engine docs are alluding to, but they
> > are not specific on the writes when the parent entity is not part of
> > the transaction, and furthermore they suggest that optimistic
> > concurrency is used and not locking, which lends credence that if the
> > parent is not involved and just new entities are being created, there
> > should be no contention. I've watched some of the Google IO videos
> > also, and they seem to suggest that, but are not specific.
>
> >http://code.google.com/appengine/docs/whatisgoogleappengine.html
>
> > Looking at the link above, under the title "The Datastore", and I
> > quote:
>
> >   "An update of a entity occurs in a transaction that is retried a
> > fixed number of times if other processes are trying to update the same
> > entity simultaneously."
>
> > This suggests that optimistic concurrency only applies if multiple
> > processes are trying to update the *same* entity simultaneously.
> > Optimistic concurrency also *implies* that first one wins.
>
> > In my case, they are not trying to update the same entity, so it
> > shouldn't matter.
>
> > It seems the app engine docs are not clear on this, and I really want
> > to leverage the entity groups in this way. Maybe one of the Google
> > guys can help clarify this?
>
> > On Jan 28, 4:56 pm, Enrique Perez  wrote:
>
> > > My understanding is that all writes within the same entity group are
> > > serialized. Hence a best practice is keep Entity Groups as small as
> > > possible. If there is contention between two simulatanous writes to
> > > the same Entity Group, one fails, and having retry logic here will
> > > help get that second write to succeed  In my experience a high
> > > percentage of write retries succeed on 2nd or 3rd retry  Hopefully
> > > this helps...
>
> > > Thanks
> > > Enrique Perez
> > > Austin, Texas
>
> > > On Jan 28, 6:47 pm, Ugorji  wrote:
>
> > > > I want to put some entities in the same entity group as a parent. If
> > > > multiple users try to create child entities at the same time, will
> > > > their put requests all lock on the parent entity and get executed in
> > > > sequence (even though I am not making any changes to the parent? and
> > > > the parent does not hold references to the children). I would hope
> > > > not, but want some clarity on this.
>
> > > > If their put requests get run one at a time, will I have to
> > > > continually retry? I read somewhere that App Engine automatically
> > > > retries non-transactional requests on failures. However, I then read
> > > > here that we should retry our requests as is typical where optimistic
> > > > concurrency is 
> > > > used.http://code.google.com/appengine/docs/java/datastore/transactions.htm...
>
> > > > What are the rules on when a retry is needed? Are they needed anytime
> > > > I try to create a child entity without affecting the parent?- Hide 
> > > > quoted text -
>
> > - Show quoted text -

-- 
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] setting null for entity field

2010-01-28 Thread Andrei
i am trying to set entity property to null,
but it does not persist it to db, it just keeps old string value
how do i set property to null?
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.