Re: [appengine-java] Re: Problem with persist a child class

2010-09-23 Thread Cyrille Vincey
There is no primary key in your child class.
Add one.

On 23/09/10 04:40, lisandrodc lisandr...@gmail.com wrote:

 Hi ! I have a problem when persist a chid class.
 The parent class:
 
 @PersistenceCapable
 
 @Inheritance(strategy = InheritanceStrategy.SUBCLASS_TABLE)
 public  abstract class Fecha   {
 
 @PrimaryKey
 @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
 private Key id;
 @Persistent
 private String nombre;
 @Persistent
 private Date fechaIni;
 @Persistent
 private Date fechaFin;
 
 @Persistent(defaultFetchGroup = true)
 ListPartido partidos;
 
 private Long id2;
 
 private Long kind;
 
 The child class:
 @PersistenceCapable(identityType =
 IdentityType.APPLICATION,detachable=true)
 public class RegFechaUsuario extends Fecha  {
 
 @Persistent
 private int puntos;
 @Persistent
 private Long idUsuarioFecha;
 @Persistent
 private Long idFechaOriginal;
 
 The method at persist:
 
 public void crearRegFechaUsuario(RegFechaUsuario regFechaUsuario) {
 //regFechaUsuario is an object initialized
 Transaction tx = pm.currentTransaction();
 try {
 tx.begin();
 
 pm.makePersistentAll(regFechaUsuario);
//here is the exception
 tx.commit();
 } finally {
 // pm.close();
 if (tx.isActive()) {
 tx.rollback();
 }
 }
 
 }
 
 
 And the exception is (internal error of the library of google apps or
 datanucleus), the cast:
 
 
 Problem accessing /Prode/JugarFecha.action. Reason:
 
 java.lang.Long cannot be cast to java.lang.String
 
 Caused by:
 
 java.lang.ClassCastException: java.lang.Long cannot be cast to
 java.lang.String
 at
 org.datanucleus.store.appengine.DatastoreRelationFieldManager.checkForParentSw
 itch(DatastoreRelationFieldManager.java:
 202)
 at org.datanucleus.store.appengine.DatastoreRelationFieldManager
 $1.setObjectViaMapping(DatastoreRelationFieldManager.java:133)
 at org.datanucleus.store.appengine.DatastoreRelationFieldManager
 $1.apply(DatastoreRelationFieldManager.java:112)
 at
 org.datanucleus.store.appengine.DatastoreRelationFieldManager.storeRelations(D
 atastoreRelationFieldManager.java:
 81)
 at
 org.datanucleus.store.appengine.DatastoreFieldManager.storeRelations(Datastore
 FieldManager.java:
 955)
 at
 org.datanucleus.store.appengine.DatastorePersistenceHandler.storeRelations(Dat
 astorePersistenceHandler.java:
 546)
 at
 org.datanucleus.store.appengine.DatastorePersistenceHandler.insertPostProcess(
 DatastorePersistenceHandler.java:
 304)
 at
 org.datanucleus.store.appengine.DatastorePersistenceHandler.insertObjects(Data
 storePersistenceHandler.java:
 256)
 at
 org.datanucleus.store.appengine.DatastorePersistenceHandler.insertObject(Datas
 torePersistenceHandler.java:
 240)
 at
 org.datanucleus.state.JDOStateManagerImpl.internalMakePersistent(JDOStateManag
 erImpl.java:
 3185)
 at
 org.datanucleus.state.JDOStateManagerImpl.makePersistent(JDOStateManagerImpl.j
 ava:
 3161)
 at
 
org.datanucleus.ObjectManagerImpl.persistObjectInternal(ObjectManagerImpl.java
:
 1298)
 at
 org.datanucleus.sco.SCOUtils.validateObjectForWriting(SCOUtils.java:
 1476)
 at
 org.datanucleus.store.mapped.scostore.ElementContainerStore.validateElementFor
 Writing(ElementContainerStore.java:
 380)
 at
 org.datanucleus.store.mapped.scostore.FKListStore.validateElementForWriting(FK
 ListStore.java:
 609)
 at
 
org.datanucleus.store.mapped.scostore.FKListStore.internalAdd(FKListStore.java
:
 344)
 at
 org.datanucleus.store.appengine.DatastoreFKListStore.internalAdd(DatastoreFKLi
 stStore.java:
 146)
 at
 org.datanucleus.store.mapped.scostore.AbstractListStore.addAll(AbstractListSto
 re.java:
 128)
 at
 org.datanucleus.store.mapped.mapping.CollectionMapping.postInsert(CollectionMa
 pping.java:
 157)
 at
 org.datanucleus.store.appengine.DatastoreRelationFieldManager.runPostInsertMap
 pingCallbacks(DatastoreRelationFieldManager.java:
 217)
 at
 org.datanucleus.store.appengine.DatastoreRelationFieldManager.access
 $200(DatastoreRelationFieldManager.java:48)
 at org.datanucleus.store.appengine.DatastoreRelationFieldManager
 $1.apply(DatastoreRelationFieldManager.java:116)
 at
 org.datanucleus.store.appengine.DatastoreRelationFieldManager.storeRelations(D
 atastoreRelationFieldManager.java:
 81)
 at
 org.datanucleus.store.appengine.DatastoreFieldManager.storeRelations(Datastore
 FieldManager.java:
 955)
 at
 org.datanucleus.store.appengine.DatastorePersistenceHandler.storeRelations(Dat
 astorePersistenceHandler.java:
 546)
 at
 org.datanucleus.store.appengine.DatastorePersistenceHandler.insertPostProcess(
 DatastorePersistenceHandler.java:
 304)
 at
 org.datanucleus.store.appengine.DatastorePersistenceHandler.insertObjects(Data
 storePersistenceHandler.java:
 256)
 at
 org.datanucleus.store.appengine.BatchPutManager.processBatchState(BatchPutMana
 ger.java:
 35)
 at
 org.datanucleus.store.appengine.BatchManager.finish(BatchManager.java:
 54)
 at org.datanucleus.store.appengine.jdo.DatastoreJDOPersistenceManager
 $BatchManagerWrapper.call(DatastoreJDOPersistenceManager.java:127)

[appengine-java] ِApp Engine Quotas

2010-09-23 Thread Ahmed Shoeib
now i want to know

if my website grows up

how can i know how much i will pay for this grow

-- 
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: ِApp Engine Quotas

2010-09-23 Thread Didier Durand
Hi Ahmed,

If you  exceed the free quota, see
http://code.google.com/appengine/docs/billing.html#Billable_Quota_Unit_Cost
to see the additional costs

didier

On Sep 23, 12:26 pm, Ahmed Shoeib ahmedelsayed.sho...@gmail.com
wrote:
 now i want to know

 if my website grows up

 how can i know how much i will pay for this grow

-- 
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: ِApp Engine Quotas

2010-09-23 Thread Ahmed Shoeib
i know that
i mean how to control that

in other word

i want to know if what the range my web site grows up
to know how much i will pay

so the problem is how can i know what the range my web site grows
up  ?

On Sep 23, 2:34 pm, Didier Durand durand.did...@gmail.com wrote:
 Hi Ahmed,

 If you  exceed the free quota, 
 seehttp://code.google.com/appengine/docs/billing.html#Billable_Quota_Uni...
 to see the additional costs

 didier

 On Sep 23, 12:26 pm, Ahmed Shoeib ahmedelsayed.sho...@gmail.com
 wrote:

  now i want to know

  if my website grows up

  how can i know how much i will pay for this grow



-- 
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] JDO - Update Partial Attributes In a Persistent Object

2010-09-23 Thread luka
Hi,

I have some JDO persistent objects which contains lots of attributes.
So in some cases I use specific Fetch Groups and retrieve only some
attributes which are relevant.
In these cases when I change the attributes which I retrieved and try
to update them the rest
of the attributes (which I did not retrieved) are being reset to null.

Can I update only partial attributes in a JDO persisted object?

-- 
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] JDO - Update Partial Attributes In a Persistent Object

2010-09-23 Thread romesh soni
Hi Luka,

How are you updating the object without having a reference of actual object
to be updated. In such case, you should be first retrieving the actual
object from db and then change the attributes and then save that object.
This process doesn't result in any loss of data and you get what you want.

Thanks
Romesh

On Thu, Sep 23, 2010 at 5:40 PM, luka uluk...@gmail.com wrote:

 Hi,

 I have some JDO persistent objects which contains lots of attributes.
 So in some cases I use specific Fetch Groups and retrieve only some
 attributes which are relevant.
 In these cases when I change the attributes which I retrieved and try
 to update them the rest
 of the attributes (which I did not retrieved) are being reset to null.

 Can I update only partial attributes in a JDO persisted object?

 --
 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.



Re: [appengine-java] JSF2 f:ajax does not work for me... Any Ideas Why?

2010-09-23 Thread Jaziel Leandro
I have the same error few times ago.
Try this, make you Bean implements Serializable.

2010/9/23 Daniel vedm...@gmail.com

 I'm want to use the f:ajax tag of the JSF 2 on app engine... but
 without any luck

 I tried some very simple examples taken from

 http://mkblog.exadel.com/2010/04/learning-jsf-2-ajax-in-jsf-using-fajax-tag/

 all of them works perfectly on local Tomcat (not GAE)

 But when i try the same on GAE, nothing works, im not getting any
 errors.. its just do nothing...
 Here the simplest example

 On each char type I'm supposed to sea the same char typed beneath and
 beneath it a counter of chars (text length) - again.. this works
 perfectly on tomcat server... (not GAE)


 Any ideas what am i missing?

 h:form
   h:panelGrid
  h:inputText value=#{bean.text} 
 f:ajax event=keyup render=text count
 listener=#{bean.countListener}/
  /h:inputText
  h:outputText id=text value=#{bean.text} /
  h:outputText id=count value=#{bean.count} /
   /h:panelGrid
 /h:form

 java code:
 package general;

 import javax.faces.bean.ManagedBean;
 import javax.faces.event.AjaxBehaviorEvent;

 @ManagedBean(name = bean)
 public class Bean {
   private String text; // getter and setter
   private Integer count;


public void countListener(AjaxBehaviorEvent event) {
   count = text.length();
}

public String getText() {
return text;
}

public void setText(String text) {
this.text = text;
}

public Integer getCount() {
return count;
}

public void setCount(Integer count) {
this.count = count;
}

 }


 Thanks ahead.

 Daniel

 --
 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] PayPal Payflow Pro Connection Error

2010-09-23 Thread Shaun
I think that this is due to Google's limitation for allowing
connections to port 443. But when I try to connect to PayPal for a
payment I get the error:

Transaction Context Errors: Message 1::
[FATAL]RESULT=-1RESPMSG=Failed to connect to host Input Server Uri=
https://pilot-payflowpro.paypal.com:443;

Is there anyway around this or will this feature be available when
Business Edition goes live? Any help is much appreciate it!

Thanks,

Shaun

-- 
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] AppStats giving very different results to the logged values in Dashboard

2010-09-23 Thread Ashley Schroder
I installed the AppStats tool in a bid to find out why my simple XML
parsing requests were using so much CPU/API time - they run in the
blink of an eye on my laptop at home so I couldn't understand why the
App Engine was reporting each one took as much as 5 seconds.

To my surprise the AppStats app reported different times.

For example:

Appstats says:
real=886ms cpu=0ms api=0ms overhead=0ms (40 RPCs)

Log says:
927ms 3000cpu_ms 2553api_cpu_ms 0kb AppEngine-Google; (+http://
code.google.com/appengine)

What's interesting is the response time 927 in the log is _close_ to
what appstats records. The cpu/api time is massively different. What
appstats reports is what I'd expect - it's just a SAX parse. As it is
I have broken the parsing into steps so that it can run at all. Maybe
I'm using a dud XML library.

Has anyone got any experience with this? Or suggestions? I was hoping
AppStats would show me the API issues, but it's just confused me more!

Is is possible my code or the app engine has an issue in it that
causes false time reporting? It's a bit weird that in a 1s request
there can be 3s of CPU time isn't it (or are all of these requests
parallel processed when possible in some clever way?)

Thanks,
Ashley

-- 
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: JDO - Update Partial Attributes In a Persistent Object

2010-09-23 Thread luka
Hi Romesh,

I do have a detached reference to the actual object with part of the
attributes populated.

My solution to modify a persistant object today combined from the
following steps:

Steps to retrie  modificaty the persistant object
---

1. Retrieving and detaching the persisting object with specific Fetch
Group
2. Making modifications in the persistant object

Steps to saving the new modified object

3. Retrieve the original object from the datastore with all the
attributes (using its Key from the detached object)
4. Update the detached object with the missing attributes
5. Saving the detached object



I was wondering if there is a way to save the 3rd and 4th steps to
improve performance while avoid loosing unpopulated attributes values.

I did try to set a FetchGroup before persisting the detached object,
although it completly ignored it
and reset the un-populated values to null.

I guess FetchGroup is not for modify or create operation only to
fetch information.

In the relational world you have the option to update certain
attributes/fields in a tabke without updating all the other
attributes.
I thought we can do it in Google JDO as well...



On Sep 23, 3:09 pm, romesh soni soni.rom...@gmail.com wrote:
 Hi Luka,

 How are you updating the object without having a reference of actual object
 to be updated. In such case, you should be first retrieving the actual
 object from db and then change the attributes and then save that object.
 This process doesn't result in any loss of data and you get what you want.

 Thanks
 Romesh

 On Thu, Sep 23, 2010 at 5:40 PM, luka uluk...@gmail.com wrote:
  Hi,

  I have some JDO persistent objects which contains lots of attributes.
  So in some cases I use specific Fetch Groups and retrieve only some
  attributes which are relevant.
  In these cases when I change the attributes which I retrieved and try
  to update them the rest
  of the attributes (which I did not retrieved) are being reset to null.

  Can I update only partial attributes in a JDO persisted object?

  --
  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] Re: DataNucleus error on Eclipse plugin windows filename too long

2010-09-23 Thread Stephen Johnson
I've posted this solution somewhere else but can't remember where.
Anyway, if you're using eclipse plugin go to Project | Properties,
choose Google \ App Engine \ ORM and only include directories that you
have classes that you want enhanced. By default it does the entire
project so that includes a lot of needless files.
Stephen

On Sep 22, 8:04 am, Marc Hacker marc1hac...@gmail.com wrote:
 Help my Mac died and after moving to Win64 my project wont enhance any
 more:

 Cannot run program C:\Program Files\Java\jre6\bin\javaw.exe (in
 directory C:\Users\zvi\workspace\TheGraph): CreateProcess error=206,
 The filename or extension is too long

 I found this thread which implies I might have too many .class files
 for the command line called by the DataNucleus enhancer but it doesn't
 say how to get it 
 working:http://groups.google.com/group/google-appengine-java/browse_thread/th...

 Thanks

 Marc

-- 
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: JSF2 f:ajax does not work for me... Any Ideas Why?

2010-09-23 Thread Daniel
Hi
this does not help... same behavior...

i got my jsf jars from here :
http://javadocs.wordpress.com/2009/10/17/mojarra-jsf-2-0-rc2-and-google-app-engine-sdk-1-2-6/
and followed the setting of web.xml from here
https://sites.google.com/a/wildstartech.com/adventures-in-java/Java-Platform-Enterprise-Edition/JavaServer-Faces/sun-javaserver-faces-reference-implementation/configuring-jsf-20-to-run-on-the-google-appengine

maybe you used different sources? if you do please let me know, also
maybe you can post your web.xml ? might be i missed something...

any other ideas are welcomed.

Thanks ahead

Daniel

On Sep 23, 3:24 pm, Jaziel Leandro jaziel...@gmail.com wrote:
 I have the same error few times ago.
 Try this, make you Bean implements Serializable.

 2010/9/23 Daniel vedm...@gmail.com

  I'm want to use the f:ajax tag of the JSF 2 on app engine... but
  without any luck

  I tried some very simple examples taken from

 http://mkblog.exadel.com/2010/04/learning-jsf-2-ajax-in-jsf-using-faj...

  all of them works perfectly on local Tomcat (not GAE)

  But when i try the same on GAE, nothing works, im not getting any
  errors.. its just do nothing...
  Here the simplest example

  On each char type I'm supposed to sea the same char typed beneath and
  beneath it a counter of chars (text length) - again.. this works
  perfectly on tomcat server... (not GAE)

  Any ideas what am i missing?

  h:form
    h:panelGrid
       h:inputText value=#{bean.text} 
          f:ajax event=keyup render=text count
  listener=#{bean.countListener}/
       /h:inputText
       h:outputText id=text value=#{bean.text} /
       h:outputText id=count value=#{bean.count} /
    /h:panelGrid
  /h:form

  java code:
  package general;

  import javax.faces.bean.ManagedBean;
  import javax.faces.event.AjaxBehaviorEvent;

  @ManagedBean(name = bean)
  public class Bean {
    private String text; // getter and setter
    private Integer count;

     public void countListener(AjaxBehaviorEvent event) {
            count = text.length();
         }

         public String getText() {
                 return text;
         }

         public void setText(String text) {
                 this.text = text;
         }

         public Integer getCount() {
                 return count;
         }

         public void setCount(Integer count) {
                 this.count = count;
         }

  }

  Thanks ahead.

  Daniel

  --
  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] Namespace design issues

2010-09-23 Thread Mouseclicker
I wanted to start a discussion about lifecycle and threading behavior
of the NamespaceManager. Much of this has been answered meanwhile in
another thread: 
http://groups.google.com/group/google-appengine-java/browse_thread/thread/8fec36b2c40f029b#

The namespace is really a great feature to have. What has been
discussed in this thread is something that should be added to the
documentation. This would help a lot.

I see two other problem areas with the current API design:

1) I understand that setting a namespace in a request context that is
inherited to the individual calls in the app engine is often the
desired behavior. But when I have set a namespace for my application
context (for example user specific) and want to update let's say a
counter for statistics in a global namespace for my application the
API is a bit inconvenient. Why is there no way to set a namespace for
an individual Key in the datastore for example? This would be much
cleaner, simpler and it is so easy to add without breaking the current
API. The need to set and later reset a global setting is dangerous and
error-prone. Probably that's what Guillaume mentions with The fear I
had was when seeing a static methods being used. I'm always afraid
when I see 'static' somewhere. Me too!

 2) To investigate the behavior of NamespaceManager I have created a
small test application (if someone is interested I can share). For
this testing purpose namespace is derived from a parameter in a URL
(it's a test app!): Here I ran quickly into an interesting issue: If
you forget which namespaces you ever have used you will never find
your data again and even worse there is no way to delete them!
Fortunately I have used the dev app server where you simply can delete
the local_db.bin file. On the cloud server you are lost..
I wonder if anyone else ran into this (having a list box in the admin
pages instead of a text field for the datastore would be very helpful
here) or did I miss something?

-- 
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 Java appstats data directly

2010-09-23 Thread Michael
In Python applications, accessing appstats data is fairly
straightforward.  Once you've imported
google.appengine.ext.appstats.recording, you can simply call
recording.load_summary_protos or recording.load_full_proto.  I'm
guessing that the key structure or namespace used for Java appstats is
different, as using the same calls against a Java app with appstats
enabled does not return any results.

I can't, however, find any source files or documentation that identify
what key structure, namespace, and object model the Java version of
appstats uses.  Does anyone have that information available?  I'd like
to periodically analyze and potentially persist my appstats data, but
I'd prefer to avoid scraping the appstats stats page.

Thanks in advance for any help.

- 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] Re: Problem with persist a child class

2010-09-23 Thread lisandrodc
Hi!Cyrille I add a primary key in my child class:

@PersistenceCapable(identityType =
IdentityType.APPLICATION,detachable=true)
public class RegFechaUsuario extends Fecha  {
@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Key id;
@Persistent
private int puntos;
@Persistent
private Long idUsuarioFecha;
@Persistent
private Long idFechaOriginal;


And the exception is:

Error in meta-data for model.RegFechaUsuario: More than one
primary key field.

Caused by:

Error in meta-data for model.RegFechaUsuario: More than one primary
key field.
org.datanucleus.store.appengine.MetaDataValidator
$DatastoreMetaDataException: Error in meta-data for
model.RegFechaUsuario: More than one primary key field.
at
org.datanucleus.store.appengine.MetaDataValidator.validatePrimaryKey(MetaDataValidator.java:
416)
at
org.datanucleus.store.appengine.MetaDataValidator.validate(MetaDataValidator.java:
120)
at
org.datanucleus.store.appengine.DatastoreManager.validateMetaDataForClass(DatastoreManager.java:
766)
at
org.datanucleus.store.appengine.DatastorePersistenceHandler.insertPreProcess(DatastorePersistenceHandler.java:
328)
at
org.datanucleus.store.appengine.DatastorePersistenceHandler.insertObjects(DatastorePersistenceHandler.java:
251)
at
org.datanucleus.store.appengine.BatchPutManager.processBatchState(BatchPutManager.java:
35)
at
org.datanucleus.store.appengine.BatchManager.finish(BatchManager.java:
54)
at org.datanucleus.store.appengine.jdo.DatastoreJDOPersistenceManager
$BatchManagerWrapper.call(DatastoreJDOPersistenceManager.java:127)
at org.datanucleus.store.appengine.jdo.DatastoreJDOPersistenceManager
$BatchManagerWrapper.access$200(DatastoreJDO

On 23 sep, 05:25, Cyrille Vincey crll...@gmail.com wrote:
 There is no primary key in your child class.
 Add one.

 On 23/09/10 04:40, lisandrodc lisandr...@gmail.com wrote:



  Hi ! I have a problem when persist a chid class.
  The parent class:

  @PersistenceCapable

  @Inheritance(strategy = InheritanceStrategy.SUBCLASS_TABLE)
  public  abstract class Fecha   {

  @PrimaryKey
  @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
  private Key id;
  @Persistent
  private String nombre;
  @Persistent
  private Date fechaIni;
  @Persistent
  private Date fechaFin;

  @Persistent(defaultFetchGroup = true)
  ListPartido partidos;

  private Long id2;

  private Long kind;

  The child class:
  @PersistenceCapable(identityType =
  IdentityType.APPLICATION,detachable=true)
  public class RegFechaUsuario extends Fecha  {

  @Persistent
  private int puntos;
  @Persistent
  private Long idUsuarioFecha;
  @Persistent
  private Long idFechaOriginal;

  The method at persist:

  public void crearRegFechaUsuario(RegFechaUsuario regFechaUsuario) {
          //regFechaUsuario is an object initialized
  Transaction tx = pm.currentTransaction();
  try {
  tx.begin();

  pm.makePersistentAll(regFechaUsuario);
                         //here is the exception
  tx.commit();
  } finally {
  // pm.close();
  if (tx.isActive()) {
  tx.rollback();
  }
  }

  }

  And the exception is (internal error of the library of google apps or
  datanucleus), the cast:

  Problem accessing /Prode/JugarFecha.action. Reason:

      java.lang.Long cannot be cast to java.lang.String

  Caused by:

  java.lang.ClassCastException: java.lang.Long cannot be cast to
  java.lang.String
  at
  org.datanucleus.store.appengine.DatastoreRelationFieldManager.checkForParentSw
  itch(DatastoreRelationFieldManager.java:
  202)
  at org.datanucleus.store.appengine.DatastoreRelationFieldManager
  $1.setObjectViaMapping(DatastoreRelationFieldManager.java:133)
  at org.datanucleus.store.appengine.DatastoreRelationFieldManager
  $1.apply(DatastoreRelationFieldManager.java:112)
  at
  org.datanucleus.store.appengine.DatastoreRelationFieldManager.storeRelations(D
  atastoreRelationFieldManager.java:
  81)
  at
  org.datanucleus.store.appengine.DatastoreFieldManager.storeRelations(Datastore
  FieldManager.java:
  955)
  at
  org.datanucleus.store.appengine.DatastorePersistenceHandler.storeRelations(Dat
  astorePersistenceHandler.java:
  546)
  at
  org.datanucleus.store.appengine.DatastorePersistenceHandler.insertPostProcess(
  DatastorePersistenceHandler.java:
  304)
  at
  org.datanucleus.store.appengine.DatastorePersistenceHandler.insertObjects(Data
  storePersistenceHandler.java:
  256)
  at
  org.datanucleus.store.appengine.DatastorePersistenceHandler.insertObject(Datas
  torePersistenceHandler.java:
  240)
  at
  org.datanucleus.state.JDOStateManagerImpl.internalMakePersistent(JDOStateManag
  erImpl.java:
  3185)
  at
  org.datanucleus.state.JDOStateManagerImpl.makePersistent(JDOStateManagerImpl.j
  ava:
  3161)
  at

 org.datanucleus.ObjectManagerImpl.persistObjectInternal(ObjectManagerImpl.java
 : 1298)
  at
  

Re: [appengine-java] Namespace design issues

2010-09-23 Thread John Patterson


On 24 Sep 2010, at 02:55, Mouseclicker wrote:

API. The need to set and later reset a global setting is dangerous and
error-prone. Probably that's what Guillaume mentions with The fear I
had was when seeing a static methods being used. I'm always afraid
when I see 'static' somewhere. Me too!


The namespace is not global or static but stored per-thread so it must  
be set for every request e.g. in a servlet Filter.  There is no  
problem setting it for a single operation if it is reset in a finally  
block.


I personally like the way that the namespace API is completely  
separated from other APIs.  In fact, I would prefer it if the memcache  
API namespace did not override the namespace API namespace... that  
caused a subtle bug the other day.


It really is very important to be able to see all the stored data in  
the datastore viewer without requiring the user to enter the  
namespace.  Especially as the user could be billed for data they  
cannot delete.


--
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.