[appengine-java] Re: I don't understand Relationships managed by JDO and Datanucleus in GAE

2009-08-24 Thread leszek
http://code.google.com/appengine/docs/java/datastore/relationships.html#Dependent_Children_and_Cascading_Deletes - Dependent Children and Cascading Deletes The App Engine implementation of JDO makes all owned relationships dependent. If a parent object is deleted, all

[appengine-java] Re: Getting a child from it's parent

2009-08-28 Thread leszek
http://code.google.com/appengine/docs/java/datastore/relationships.html = Child objects are loaded from the datastore when they are accessed for the first time. If you do not access the child object on a parent object, the entity for the child object is never loaded. (The datastore

[appengine-java] Re: Getting a child from it's parent

2009-08-28 Thread leszek
You have to touch child field while the parent is still managed by PersistenceManager, before detaching (pm.close). Something like: PersistenceManager pm = PMF.get().getPersistenceManager(); try { Employee e =

[appengine-java] Re: deployment issues

2009-08-28 Thread leszek
Look here: http://code.google.com/status/appengine It seems that GAE Java was having some problems yesterday. Error 500 suggests some problems on the server side. But I'm guessing only. --~--~-~--~~~---~--~~ You received this message because you are subscribed to

[appengine-java] Re: is not that of an entity but needs to be for this operation when persist entity

2009-08-28 Thread leszek
What you mean by: -- I get this error (only on GAE enviroment, because on my local development IDE work ok)... - You mean that your code works while running on local datastore and not work after deploying to the google (production) environment ?

[appengine-java] Re: jdo date

2009-08-28 Thread leszek
Look at: http://www.jpox.org/docs/1_1/query_jdoql_methods.html But I cannot tell if it is supported in GAE plugin for DataNucleus. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google App Engine for Java group.

[appengine-java] Re: jdo date

2009-08-28 Thread leszek
Try also with two Date fields - the second keeping the year/month/date part only Something like: // Entity @Persistent private Date birthDate; @Persistent private Date birthDateOnly; public void setBirthDate(Date birthDate) { this.birthDate = birthDate; if

[appengine-java] Re: jdo date

2009-08-29 Thread leszek
Hm Could you elaborate a little more on that ? --~--~-~--~~~---~--~~ 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

[appengine-java] Re: issue about JDO Relationship in JUnit

2009-08-29 Thread leszek
But what you have while running this assert ? I dare say that p2.getSentences.size() is 0 at that moment. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send

[appengine-java] Re: jdo date

2009-08-29 Thread leszek
You are right, but 'midomarocain'' wants to keep full date (with hours/ min/secs) and in one context compare the full date and in the another context compare the same date but using the year/month/day part only. But, of course, it is possible to split the date to java.sql.Date and java.sql.Time

[appengine-java] Re: Exception on creation of java.io.File in GAE

2009-08-31 Thread leszek
http://code.google.com/appengine/docs/java/config/appconfig.html May be you find there the solution, but I'm guessing only. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post

[appengine-java] Re: Unowned relationships

2009-09-01 Thread leszek
You can follow something like that class Parent { @Persistent private ListLong/Key childList; // non Persistent private ListChild list; ... } class Child { @PrimaryKey private Long/Key key; ... } // before save Parent private void beforeSave(EntityManager

[appengine-java] Re: i have create a gwt project ,now when deploy the project with gae ,some problem has appear

2009-09-01 Thread leszek
It is a common problem. Read this thread:

[appengine-java] Re: Using external jars

2009-09-01 Thread leszek
But what class cannot be found ? Are you sure that you have put flexjson and all necessary jars in WEB-INF/lib directory of your project ? --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google App Engine for Java

[appengine-java] Re: who can help me

2009-09-02 Thread leszek
Look into this file: WEB-INF/web.xml. It looks like XML-syntax problem. --~--~-~--~~~---~--~~ 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

[appengine-java] Re: A matter in local time

2009-09-02 Thread leszek
If you delete double declaration (String formattedDate) and add proper imports and declaration 'Calendar cal = Calendar.getInstance()); it should work. But you are having this problem while running in local environment (in your machine) or it does not work after deploying to google (production)

[appengine-java] Re: self join in google app engine

2009-09-02 Thread leszek
Read this thread - could be helpfull : http://groups.google.co.uk/group/google-appengine-java/browse_frm/thread/3affdf1441f864b6/99a166946ad0ef61?lnk=gstq=self#99a166946ad0ef61 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

[appengine-java] Re: HttpSession handling question

2009-09-03 Thread leszek
Have you enabled session ? By default it is read-only. WEB-INF/appengine-web.xml. sessions-enabledtrue/sessions-enabled http://code.google.com/appengine/docs/java/config/appconfig.html --- Enabling Sessions App Engine includes an implementation of sessions, using the servlet session

[appengine-java] Re: How to make a isKeysOnly() query in JDO?

2009-09-03 Thread leszek
But how do you want to accomplish it ? There is no query like give me the next no more than 1000 keys using filter key lastkey. Also there is no query like give me the least key using filter key lastkey. --~--~-~--~~~---~--~~ You received this message because

[appengine-java] Re: JDO queries on owned/unowned one-to-many relationships

2009-09-04 Thread leszek
You can run queries on keys: http://code.google.com/appengine/docs/java/datastore/queriesandindexes.html#Queries_on_Keys The first part of child key (ContactInfo.class) contains parent (Employee) key. Employee e; query = pm.newQuery(ContactInfo.class); query.setFilter(key ==

[appengine-java] Re: JDO queries on owned/unowned one-to-many relationships

2009-09-04 Thread leszek
query.setFilter(key keyParam and key keyParam1); --~--~-~--~~~---~--~~ 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

[appengine-java] Re: Master/Detail relations and redundant data handling

2009-09-07 Thread leszek
I'm not sure if your taking of the problem is correct. To my mind it runs: You have Company and Employee. Company has many Employees and Employee is working for one company. Normalized version looks like: class Company { @Persistent private String companyName; @Persistent private String

[appengine-java] Re: Initializing Datastore

2009-09-09 Thread leszek
But what you mean by real application ? If you want to have a server part of your application and client part running outside Google App Engine you can implement access to the server part and Google App Engine datastore via servlet and standard GET/POST request.

[appengine-java] Re: testing persistence with one to many relashionship

2009-09-09 Thread leszek
It works for me. I have something like: class Employee { ... @Persistent(mappedBy=employee) private ListContactInfo contactInfo; .. } class ContactInfo { @PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) private Key key; ...} than: Employee e;

[appengine-java] Re: Problem saving an object using makePersistent

2009-09-09 Thread leszek
Replace: @Persistent with: @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) Otherwise provide some code how you call the method public void saveUser(User user) (I'm guessing that this method throws exception). particulary how the 'user' parameter is created.

[appengine-java] Re: Own Login system

2009-09-10 Thread leszek
Why not create simple CRUD for keeping log-id and password and simple dialog to get login id and password and check against persisted class being managed by this CRUD. It could be a good starting point. --~--~-~--~~~---~--~~ You received this message because you

[appengine-java] Re: Tomcat Instead of Jetty.

2009-09-10 Thread leszek
But do you mean GWT or Google App Engine application ? GWT comes with embedded tomcat to keep backward compatiblity. Although there is a warning that it is deprecated and can be deleted in the future. If you want to use tomcat simply start shell as it is described in documentation for GWT 1.5

[appengine-java] Re: Can I avoid Data Nucleus and still use JPA?

2009-09-14 Thread leszek
Hibernate is not JPA implementation, it exposes its own API. Hibernate Entity Manager is a product build on standard Hibernate and offering full JPA interface. Google App Engine does not support Hibernate: http://groups.google.com/group/google-appengine-java/web/will-it-play-in-app-engine

[appengine-java] Re: Create different entity (Database) for each user.

2009-09-14 Thread leszek
Look at this thread, may provide some useful information. http://groups.google.co.uk/group/google-appengine-java/browse_frm/thread/6ae2e6737cbb4b40/f47f015099538467?lnk=gstq=administrator#f47f015099538467 --~--~-~--~~~---~--~~ You received this message because you

[appengine-java] Migration to Google App Engine for Java

2009-09-14 Thread leszek
Some thoughts based on experience. http://hoteljavaopensource.blogspot.com/2009/09/migration-to-google-app-engine.html --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to

[appengine-java] Re: Can I avoid Data Nucleus and still use JPA?

2009-09-15 Thread leszek
Nobody can contradict that DataNucleus is a high quality software. The fact that it is Google's persistence provider of choice speaks for itself. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google App Engine for

[appengine-java] Re: Regarding debugging error

2009-09-15 Thread leszek
Replace: filter-classAuthFilter/filter-class With filter-classcom.org.login.AuthFilter/filter-class --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send

[appengine-java] Re: RPC call and variables

2009-09-15 Thread leszek
It is a clustered environment and you cannot assume that every request is run in the JVM. If you want to share data between requests you should persist them (data) in datastore. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

[appengine-java] Re: RPC call and variables

2009-09-16 Thread leszek
Follow this thread - could be helpful http://groups.google.co.uk/group/google-appengine-java/browse_frm/thread/d816992c5a82506b/e50b4eb988d2f45b?lnk=gstq=comet#e50b4eb988d2f45b --~--~-~--~~~---~--~~ You received this message because you are subscribed to the

[appengine-java] Re: Unicode problems

2009-09-17 Thread leszek
I'm using GWT on the client side. --~--~-~--~~~---~--~~ 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

[appengine-java] Re: self referral one-to-many relationship with null root

2009-09-17 Thread leszek
Follow this thread: http://groups.google.co.uk/group/google-appengine-java/browse_frm/thread/3affdf1441f864b6/47e35ad2811de108?lnk=gstq=self#47e35ad2811de108 It looks like known issue. --~--~-~--~~~---~--~~ You received this message because you are subscribed to

[appengine-java] Re: Problem with JDO - Attempt was made to manually set the id component of a Key primary key

2009-09-18 Thread leszek
Could you provide more details, how your entity class looks like and how it is persisted ? --~--~-~--~~~---~--~~ 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

[appengine-java] Re: date between jdo query

2009-09-18 Thread leszek
Could you provide more details how your failing query looks like ? --~--~-~--~~~---~--~~ 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

[appengine-java] Re: Problem with JDO - Attempt was made to manually set the id component of a Key primary key

2009-09-18 Thread leszek
There is nothing wrong with that, it should work. Could you past also a persiting sequence, where this exception is thrown. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to

[appengine-java] Re: Accessing Memcache in more than one servlet

2009-09-18 Thread leszek
The second. If you get an object from the cache you have the serialized copy of the object. So to make your changes persistent and visible by the other requests you have to put it into the cache again. Also to have a fresh object you have to get it again. What you have is a reference to the

[appengine-java] Re: Type Owned by Two Different Types?

2009-09-21 Thread leszek
That's very interesting because it works for me: @PersistenceCapable(identityType = IdentityType.APPLICATION) public class Employee { @PrimaryKey @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY) private Key id; private String firstName; private String lastName; }

[appengine-java] Re: How to location my service in Unit testing?

2009-09-23 Thread leszek
You need to have your data access method separated from servlet code or RPC (if GWT is used) code. Assume that you have something like: class Customer { private Key customerId; ... } class MyDataAccessService { public void addCustomer(Customer c) { ... } and you want to test it.

[appengine-java] Re: JDO vs low level API

2009-09-24 Thread leszek
De gustibus non est disputandum - if you feel more comfortable with low-level Api than with JDO/JPA Api it is up to you. You spent two days trying to cope with Google App Engine JPA/JDO problem, I spent a lot of sleepless nights migrating my EJB3/JPA application to Google App Engine keeping

[appengine-java] Re: Delete all from datastore

2009-09-24 Thread leszek
If you want to clean your local datastore with respect to junit tests - look at this link: http://code.google.com/appengine/docs/java/howto/unittesting.html --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google App

[appengine-java] Re: Single transaction and makePersistentAll

2009-09-24 Thread leszek
Obviously it will not work, makePersistentAll is nothing more than: for (Entity e : parameter_List) { em.makePersistent(e); } --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To

[appengine-java] Re: java swing api usage proble

2009-09-24 Thread leszek
You have to split your application into at least two parts: server part (without any user interface related logic) and client side, user interface. This client side can be java/swing (applet), or Java Script, HTML, JSP etc. --~--~-~--~~~---~--~~ You received this

[appengine-java] Re: Caching using static fields

2009-10-19 Thread leszek
What about using memcache as keeping cache version counter ? When update is needed than this counter is increased. Every requests keeps local number and at the beginning compare local counter against memcache counter. If not equal than refresh local cache and local cache number. If memcache

[appengine-java] Re: Selecting more than 1000 rows ?

2009-10-20 Thread leszek
1000 is a hard limitation on every query. So if you have 5000 entitties and use range 999-1500 you will get only one record. The only way is to iterate through entities using JDO extend. --~--~-~--~~~---~--~~ You received this message because you are subscribed to

[appengine-java] Re: Possible to Add Child to Owned One to Many Relationship Without Loading All Children?

2009-10-20 Thread leszek
I'm afraid that it is not possible. But if the purpose of your relationship is only to manage child class in a transactional way you don't need to keep them as a part of child relationship. Simply use Key type and set 'parent' part of the child' key being the same and you can manage them in the

[appengine-java] Re: Possible to Add Child to Owned One to Many Relationship Without Loading All Children?

2009-10-21 Thread leszek
You hit the nail on the head. As far as I know there is nothing like sequence in Google App Engine. Either you need to have another entity with a counter and increase it in transactional way. Or you can use memcache.

[appengine-java] Re: Servelts versus JSPS

2009-10-21 Thread leszek
JSP is nothing more than servlet code woven with html and some tags to make generating html pages more easy. Almost everything you can do in sevlet code you can do also in JSP page. So it is a design decision what logic should be kept in JSP and what logic should tackled in a classic servlet

[appengine-java] Re: Can fliter the child class based on parent class's property?

2009-10-21 Thread leszek
It is not possible, your query filter should contain only 'direct attributes of the class. if you want to run query based on class number you need to have to duplicate this property from Classroom to Student. But I don't understand your problem. If you have 'one to 'many' relationship and want

[appengine-java] Re: primary key portability

2009-10-23 Thread leszek
I ported my Open Source EJB3/JPA application to Google App Engine many months ago and almost at the beginning it was obvious that I had to split my entity classes to two versions: Google App Engine and non Google App Engine. Impossible to achieve 100% source compatibility. Primary key not

[appengine-java] Re: Problem with saving parent entity

2009-10-23 Thread leszek
It looks for me that you mix JPA annotations (OneToMany, Entity, Id) with JDO api. - using PersistenceManager. It is hard to say how it behaves and disentangle that issue. But if you want to have bi-directional ownership - in News entity Source instance - follow this thread, it could shed some

[appengine-java] Re: SimpleDS: an alternative for Datastore persistence

2009-10-23 Thread leszek
Do you have some more doc/java doc ? I was browsing through your page and found nothing. As far as I caught you implemented simple set of CRUD operations on items and simple query mechanism. Am I right ? The decision to get rid of relationships is very sound because this GAE/J implementation is

[appengine-java] Re: Storing and managing a collection of objects in a HttpSession.

2009-10-26 Thread leszek
http://code.google.com/intl/pl/appengine/docs/java/config/appconfig.html === App Engine includes an implementation of sessions, using the servlet session interface. The implementation uses the App Engine datastore and memcache to store session data. This feature is off by

[appengine-java] Re: Not sure I'm using Memcache properly

2009-10-28 Thread leszek
It looks ok, the only problem I can see that something can happen between storing book in cache and getting book from cache. Scenario like: 1) fetch book from Amazon and store in cache. 2) book expires in Amazon (or any other event happens) 3) next request - get data from cache - you return

[appengine-java] Re: Concurrency In Transaction

2009-10-28 Thread leszek
http://code.google.com/intl/pl/appengine/docs/java/datastore/transactions.html Look at the next code snippet === for (int i = 0; i NUM_RETRIES; i++) { pm.currentTransaction().begin(); ClubMembers members = pm.getObjectById(ClubMembers.class, k12345);

[appengine-java] Re: Weird Life Cycle of Servlet in GAE

2009-10-28 Thread leszek
Is it production or local (development) environment ? --~--~-~--~~~---~--~~ 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

[appengine-java] Re: Weird Life Cycle of Servlet in GAE

2009-10-28 Thread leszek
It is a clustered environment. So it is expected that the next request is run on a different machine, JVM and all statics are reinitialized. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google App Engine for Java

[appengine-java] Re: Not sure I'm using Memcache properly

2009-10-29 Thread leszek
You mean Google App Engine/J implementation of this ? http://code.google.com/intl/pl/appengine/docs/python/urlfetch/asynchronousrequests.html --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google App Engine for

[appengine-java] Re: Need help on how to enhance the data classes with netbeans

2009-10-29 Thread leszek
Thanks, I will try. I'm using eclipse only because of this Google plugin, I'm rather fan of NetBeans. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google App Engine for Java group. To post to this group, send

[appengine-java] Re: JDO Unowned Relationship Issue

2009-10-29 Thread leszek
You have now: employee.addComputer(computer); pm.close(); Replace with: employee.addComputer(computer); pm.makePersistent(employee); pm.close(); You update entity but don't persist it again. Also replace: @Persistent public SetLong computerKeys = new HashSetLong();

[appengine-java] Re: Deploy webservices

2009-10-29 Thread leszek
Follow this thread: http://groups.google.co.uk/group/google-appengine-java/browse_frm/thread/e29a06508797545c/b456c04790f20181?lnk=gstq=webservice#b456c04790f20181 --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups

[appengine-java] Re: JDO Best Practices

2009-11-03 Thread leszek
DM - http://vike.googlecode.com/svn/trunk/vike/src/br/com/ximp/vike/server... Judging from above you don't use JPO but low level API. But your entity class (Actor) is dressed with JDO annotations. I don't know what will happen if entity dressed with JPA annotiation and beautified by JDO enhancer

[appengine-java] Re: thanking uuuuuuuuu

2009-11-04 Thread leszek
http://groups.google.co.uk/group/google-appengine-java/browse_frm/thread/b2d502bc03c83155# --~--~-~--~~~---~--~~ 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

[appengine-java] Re: What defines a single transaction in JDO?

2009-11-04 Thread leszek
Sequence: tx.begin(); ,,, persist Entity group A tx.commit(); tx.begin(); .. persist Entity group B tx.commit(); works without any problem as designed. You have to provide more details to tell something. --~--~-~--~~~---~--~~ You received this message because

[appengine-java] Re: Querying for entities by filtering by key

2009-11-06 Thread leszek
@Persistent(mappedBy = A) Judging from: http://www.jpox.org/docs/1_2/jdo/annotations.html -- mappedByString Field in other class when the relation is bidirectional to signify the owner of the relation -- 'mappedBy' does not make any sense outside relationships.

[appengine-java] Re: GWT Vs JQuery

2009-11-06 Thread leszek
In Polish language it is called a discussion o wyższości Swiąt Wielkiej Nocy nad Swiętami Bożego Narodzenia.- in English it is a discussion on superiority Christmas over Easter or vice versa or simply discussion on nothing. So it is like discussion on what is better: GWT, JQuery, Dojo, Ext- Gwt,

[appengine-java] Re: Which datastore exceptions are appropriate for Re-try

2009-11-09 Thread leszek
http://code.google.com/intl/pl/appengine/docs/java/datastore/transactions.html for (int i = 0; i NUM_RETRIES; i++) { pm.currentTransaction().begin(); ClubMembers members = pm.getObjectById(ClubMembers.class, k12345);

[appengine-java] Re: How to add new module?

2009-11-09 Thread leszek
It looks like GWT (not Google App Engine) problem: http://code.google.com/intl/pl/webtoolkit/doc/1.6/DevGuideOrganizingProjects.html#DevGuideModules --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Google App Engine

[appengine-java] Re: Querying sub objects with JDOQL in GAE/J

2009-11-17 Thread leszek
It is not supported in Google App Engine JPA/JDO http://code.google.com/intl/pl/appengine/docs/java/datastore/usingjdo.html#Unsupported_Features_of_JDO Join queries. You cannot use a field of a child entity in a filter when performing a query on the parent kind. Note that you

[appengine-java] Re: Is there a recommended way to differentiate between production and dev GAE environments?

2009-11-23 Thread leszek
Follow that thread: http://groups.google.co.uk/group/google-appengine-java/browse_frm/thread/8145f547cbaff99e/453847dda0217e71?q=#453847dda0217e71 -- 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

[appengine-java] Re: Any Sample Authentication Examples using GWT-App Engine

2009-11-25 Thread leszek
http://code.google.com/p/google-web-toolkit-incubator/wiki/LoginSecurityFAQ -- 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,

[appengine-java] Re: Point to application database with JUnit Test

2009-12-02 Thread leszek
This type of tests works for me without any problem. Could you provide more details and what you mean exactly by system was unable to read it ? -- 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

[appengine-java] Re: jdo on app engine

2009-12-02 Thread leszek
If you use pure long primary key than it can impact transactional mechanism which is related to so called entity groups identified by primary key values. So before designing your entity classes read through: http://code.google.com/intl/pl/appengine/docs/java/datastore/transactions.html -- You

[appengine-java] Re: Point to application database with JUnit Test

2009-12-03 Thread leszek
Judging from: http://code.google.com/intl/pl/appengine/docs/java/howto/unittesting.html --- if every test starts with a clean datastore --- it clears local datastore every time - so it works as expected. But may be after removing line: datastoreService.clearProfiles();

[appengine-java] Re: Persisting class hierarchies

2009-12-03 Thread leszek
Inheritance and class hierarchy is very important in OOP but it has a different meaning when it comes to persistence. You cannot take advantage of OOP concepts like: encapsulation, polymorphic etc. So, as Ikai pointed above, you can run into over-engineering trap going that way. In my opinion the