[appengine-java] Re: New template project for Wicket on Google App Engine

2010-02-22 Thread a.maza
this is a nice thing. thanks for providing this template to the
community...


On 21 Feb., 16:19, SRF srfar...@gmail.com wrote:
 I put together a project to help developers get started with deploying
 a Wicket application on Google App Engine. It's a re-implementation of
 the Guestbook demo. It also uses Guice for dependency injection and
 includes a servlet filter that automatically sets up the JDO
 persistence manager for injection on each request.  The project is
 build with Maven and (optionally) uses the maven-gae-plugin for
 interacting with the App Engine SDK.

 If you are interested, please have a look:

    http://code.google.com/p/wicket-gae-template/

 I'll be happy to respond to any issues that you may find.

-- 
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: Compass on Google App Engine

2010-02-17 Thread a.maza
checkout the latest source from compass. The last commit removes the
Referencable interface.

On 17 Feb., 14:36, Raphael André Bauer raphael.andre.ba...@gmail.com
wrote:
 On Tue, Feb 16, 2010 at 8:15 AM, yonny yon...@googlemail.com wrote:
   Hello Folks,
     I think deploying a compass app on gae is not possible because the
  core compass interface extends javax.naming.Referenceable which is not
  on google's whitelist.I encoutered a similar problem when I call
  buildCompass() It throws a NoClassDefFoundError on
  org.compass.core.impl.DefaultCompass  Any thoughts?? anyone?

 follow this 
 one:http://www.kimchy.org/searchable-google-appengine-with-compass/
 ra





  --
  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 
  athttp://groups.google.com/group/google-appengine-java?hl=en.- Zitierten 
  Text ausblenden -

 - Zitierten Text anzeigen -

-- 
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: Compass on Google App Engine

2010-02-17 Thread a.maza
did you experience the problems in production environment or already
in the development environment?

May the indexing problem be avoided when using task queues?  what do
you think?

On 17 Feb., 18:30, Raphael André Bauer raphael.andre.ba...@gmail.com
wrote:
 On Wed, Feb 17, 2010 at 3:42 PM, John Patterson jdpatter...@gmail.com wrote:
  I thought I read somewhere on this list that compass and lucene cannot
  perform well on the datastore due to the number of index segments that need
  to be read for every query?

 i could not get it up and running one month ago with a large datset. i
 know the compass people are working hard to resolve issues with the
 gae, but i doubt (technically) that lucene is able to run properly on
 the app engine datastore (please correct me).

 it might, however, run well with a smaller dataset (100megs, offline
 indexing, and/or using an index file in the war folder)...

 ra!





  On 17 Feb 2010, at 21:23, a.maza wrote:

  checkout the latest source from compass. The last commit removes the
  Referencable interface.

  On 17 Feb., 14:36, Raphael André Bauer raphael.andre.ba...@gmail.com
  wrote:

  On Tue, Feb 16, 2010 at 8:15 AM, yonny yon...@googlemail.com wrote:

   Hello Folks,
    I think deploying a compass app on gae is not possible because the
  core compass interface extends javax.naming.Referenceable which is not
  on google's whitelist.I encoutered a similar problem when I call
  buildCompass() It throws a NoClassDefFoundError on
  org.compass.core.impl.DefaultCompass  Any thoughts?? anyone?

  follow this
  one:http://www.kimchy.org/searchable-google-appengine-with-compass/
  ra

  --
  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
  athttp://groups.google.com/group/google-appengine-java?hl=en.- Zitierten
  Text ausblenden -

  - Zitierten Text anzeigen -

  --
  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.- Zitierten Text 
 ausblenden -

 - Zitierten Text anzeigen -

-- 
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: Estimated expiration average of an entity in memcache

2010-02-10 Thread a.maza
thanks for your detailed answer.

however, I think I won't be able to track the miss rate, since I am
not keeping information which key/value pair's I am putting in
memcache (since this would require to keep the list of keys again in
memcache). Instead, I would like to fetch the data using the newly
introduced grabTail function.

On 10 Feb., 00:34, Ikai L (Google) ika...@google.com wrote:
 You really aren't going to get a useful answer to this question without
 doing some testing yourself. There are several factors that can influence
 this:

 - How many items are you putting into Memcache?
 - How large are the items?
 - Are you forcing the old items out via LRU?

 Other applications with even only minor deviations in numbers from yours
 will see significantly different results simply due to different usage
 patterns.

 I like the way you're approaching the problem - non-critical data that is
 regularly flushed. This is the way we'd like to encourage developers to
 think about how to scale their applications: differentiating between what is
 critical, non-critical, what can be done synchronously versus what can be
 done asynchronously. I'd toy with the cron jobs and track a miss rate as a
 function of the length of the cron job interval. There's probably a stable
 balance between acceptable miss rate and minimizing datastore updates you
 can achieve that may very well change with time as you change the data being
 saved or as your application's usage patterns shift.





 On Sun, Feb 7, 2010 at 4:34 AM, a.maza andr.m...@gmail.com wrote:
  Hello,

  I am keeping non-critical data (which is updated quite often) in
  memcache. I would like to use a cronjob to fetch the data in frequent
  intervalls from memcache in order to persist it to the datastore.

  Thus, I would be interested if anyone has any experiences with the
  average expiration time of entities that are kept in memcache (and
  there quite frequentally accessed) - 5min? 10min?

  Thanks and regards,
  andr

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

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

 - Zitierten Text anzeigen -

-- 
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] Estimated expiration average of an entity in memcache

2010-02-07 Thread a.maza
Hello,

I am keeping non-critical data (which is updated quite often) in
memcache. I would like to use a cronjob to fetch the data in frequent
intervalls from memcache in order to persist it to the datastore.

Thus, I would be interested if anyone has any experiences with the
average expiration time of entities that are kept in memcache (and
there quite frequentally accessed) - 5min? 10min?

Thanks and regards,
andr

-- 
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: Question: best practice to persist medium-large data?

2010-01-27 Thread a.maza
in principle, I like to work with both, JDO and JPA. but using either
of them requires (in most cases) use of the osiv pattern, which in
turn results in using something like spring. Keeping the discussions
about request and startup performance in mind, apps on GAE shouldn't
make use of too many frameworks...

thus, I am thinking about re-designing my persistence architecture
based on JDO and Spring...



On 27 Jan., 01:40, Jeff Schnitzer j...@infohazard.org wrote:
 Here's the Objectify version of what's described in the video, capable
 of a photo-equivalent of million user fanout:

 class Album {
   �...@id Long id;
    String name;}

 class PhotoIndex {
   �...@id Long id;
   �...@parent OKeyAlbum album;
    SetOKeyPhoto photos;}

 class Photo {
   �...@id Long id;
    String caption;
    String blobStoreKey;

 }

 If you want to ask what albums are this photo in? (equivalent to
 what messages are waiting for me in the video), you query like this:

 OQueryPhotoIndex query =
 createQuery(PhotoIndex.class).filter(photos, photoKey);
 ListOKeyAlbum keys = ofy.prepareKeysOnly(query).asList();
 ListAlbum albums = ofy.get(keys);

 Jeff



 On Tue, Jan 26, 2010 at 4:08 PM, Duong BaTien duong.bat...@gmail.com wrote:
  Hi Jeff:

  I am here again and have put sometime in Objectify. Thanks for taking
  pain at different design patterns. Please let the list known your effort
  in the good idea #2, especially in the social graph set intersections
  and union.

  Duong BaTien
  DBGROUPS and BudhNet

  On Tue, 2010-01-26 at 14:19 -0800, Jeff Schnitzer wrote:
  On Mon, Jan 25, 2010 at 11:52 PM, John Patterson jdpatter...@gmail.com 
  wrote:

   This is why you configure what type of relationship is used using: 
   @Embed,
   @Entity(PARENT), @Entity(CHILD) or @Entity(INDEPENDENT)
   So you have the flexibility to choose configuration _without_ rewriting 
   your
   code.  Very important difference.

  The problem is that it *isn't* as simple as just changing an
  annotation.  Not in appengine, at any rate.  It works in the simple
  case (good for demos and sample apps), but you start to notice edge
  cases:

   * In some representations you can add a Photo to an Album in a
  transaction, in some representations you can't.
   * In some representations, multiple queries are required to fetch a
  fetch an Album containing a Photo.
   * Each representation has a completely different query syntax.

  Twig exposes the datastore Query object, which means the developer
  gets the full brunt of this exposure.

  I don't want to say that it isn't possible to build a system that
  abstracts entities into a sophisticated object graph - clearly, we
  have JDO  JPA.  What I'm saying is that the people who created JDO 
  JPA are not idiots (although I do think the creators of JDO's
  annotations are aesthetically challenged).  The reason JDO has all
  that complexity and endless configuration and query languages and
  fetch groups and proxies and detaching and whatnot is because that's
  what you need to abstract an arbitrary entity graph.

   Currently the first type of representation is not an option.  I do want 
   to
   add this as it makes very large collections that change often much more
   efficient.  When it is added you could reconfigure your data schema by
   changing a single annotation.  Such a change in Objectify would require 
   the
   developer to rewrite their entire data layer

  You can never just reconfigure your data schema with a single
  annotation, both for the reasons above and because you probably have
  real-world data to migrate.  And real-world constraints demand a
  particular schema!

  Let's actually answer the original poster's question - how do you
  model a photo album?  I hope he's still listening :-)

  The first question is how you should model it in the datastore?  I'll
  use Objectify's syntax  here because it corresponds directly to the
  datastore representation.

  Actually, let's start by describing how you SHOULDN'T model a photo album.

  -

  BAD IDEA #1:

  class Album {
      @Id Long id;
      String name;
      ListOKeyPhoto photos;
  }
  class Photo {
      @Id Long id;
      String caption;
      String blobStoreKey;    // key to GAE's blobstore
  }

  Fetching photos in an album (again, Objectify syntax but equivalent to
  the datastore operation) is:

  ListPhoto fetched = ofy.get(album.photos);

  There are two reasons why this is a bad idea:

   1) You now have a hard limit of 5,000 photos per album, established by 
  GAE.

   2) Every time you load an Album, you must load the entire set of
  Photo keys.  Want to generate a list of Album names?  You have to load
  all that key data, orders of mangitude more data than what you want.

  -

  BAD IDEA #2:

  class Album {
      @Id Long id;
      String name;
  }
  class Photo {
      @Id Long id;
      @Parent OKeyAlbum album;
      String caption;
      String blobStoreKey;
  }

  This stores the Photo with the Album 

[appengine-java] Re: Question: best practice to persist medium-large data?

2010-01-26 Thread a.maza
sorry for this maybe thumb question, but I just want to make sure:
both frameworks  are making the needs for open session in view (as
almost required when using jdo/jpa in web applications) obsolete,
or?

regards,
andr

On 26 Jan., 12:18, John Patterson jdpatter...@gmail.com wrote:
 Hi Chau, yes both Objectify and Twig replace JDO/JPA.  I think that  
 Google would not release a non-standard datastore user-level API  
 because they could then be accused by many of vendor lock-in.  When  
 App Engine was launched there was a lot of concern about this.

 On 26 Jan 2010, at 16:59, Chau Huynh wrote:



  Thanks John and Jeff for sharing the knowledge.
  I've just quickly scanned your project home, and I have a novice  
  question that needs your help:
  Is twig or Objectify direct replacement to JDO / JPA on GAE? I just  
  need to use your framework alone, or should use in combination with  
  JDO / JPA support?

  What is about the approach implementing general JDO / JPA fit to  
  Datastore? Is there a chance Google provide a specific  
  implementation to their Datastore?
  Maybe someone from Google can advise on this?

  Thanks,
  -Chau

  On Tue, Jan 26, 2010 at 2:52 PM, John Patterson  
  jdpatter...@gmail.com wrote:

  On 26 Jan 2010, at 13:37, Jeff Schnitzer wrote:

  I can't resist a conversation about framework design philosophy :-)

  Oh go on then.  Just a quickie.

  This sort of binding (property of ListPhoto) can be convenient in
  some applications, and as a longtime Hibernate user I got used to
  working like this.  But I don't like this abstraction in AppEngine.
  Yes, for some apps you might be able to remove the pollution of
  framework classes like Key (or OKey), but it comes with a price.

  Twig and Objectify operate at very different levels of abstraction.  
  With Objectify you code at a lower level very aware of what is  
  happening at the datastore level.  It involves more work but, as you  
  point out, if something goes wrong - it goes wrong in your own code  
  where you are in a better position to handle it.

  With Twig you operate at a higher level that makes the persistence  
  layer almost completely transparent.  One major advantage of this is  
  that you can change the way the data is stored (i.e. embedded or  
  separate entity) without changing your code.  Making such a change  
  with Objectify means you need to rewrite your reference handling  
  code yourself.

  A one-to-many relationship between Album and Photo has several
  standard representations in AppEngine:

  * The Photo could have a Key property pointing to Album
  * The Photo could have a parent ancestor in its Key which points to  
  the Album
  * The Album entity could have a ListKey property pointing to its  
  Photos

  Each choice has a dramatic impact on performance, what can be done in
  a transaction, and how you do queries that simply cannot be glossed
  over or abstracted away.

  This is why you configure what type of relationship is used using:  
  @Embed, @Entity(PARENT), @Entity(CHILD) or @Entity(INDEPENDENT)

  So you have the flexibility to choose configuration _without_  
  rewriting your code.  Very important difference.

  Currently the first type of representation is not an option.  I do  
  want to add this as it makes very large collections that change  
  often much more efficient.  When it is added you could reconfigure  
  your data schema by changing a single annotation.  Such a change in  
  Objectify would require the developer to rewrite their entire data  
  layer

  Which does the ListPhoto represent?
  Furthermore, is ListPhoto a proxy or did the photos get fetched
  along with the Album?  Can I serialize the Album or do I need to
  detach it?

  Yes instances are just normal POJOs so no problems serializing.  I  
  do this myself with GWT.

  Currently, lazy references are not supported... its a very important  
  feature on the TODO list.

  Even worse, there are also two more possible representations:

  * The Photo could have a Key property (or ancestor) pointing to an
  Album that does not exist

  An inconsistent datastore is a problem with any framework -  
  including Objectify.  The trick is to use transactions where  
  possible whenever working on an entity group to avoid getting this  
  situation in the first place.

  * The Album could have a ListKey property, and some of the Keys
  could point to Photos that do not exist

  As above.  An exception would be thrown saying which property on  
  what object could not be found.

  Maybe these are degenerate cases, maybe not, but you'll never be able
  to completely avoid them.  RDBMSes have transactions and referential
  integrity constraints that guarantee these later two cases can't
  happen.  Not so in AppEngine.  You're just one
  DatastoreTimeoutException away from having to deal with this  
  situation
  in your code.

  If your data is inconsistent you have a problem - whether the  
  framework throws an 

[appengine-java] Re: Retrieving an entity using a different key type than the key field in the class

2009-12-18 Thread a.maza


On 17 Dez., 23:11, Ikai L (Google) ika...@google.com wrote:
 When you say it doesn't work, do you mean that it does not retrieve the
 entity?

right, no entity was found.

Can you try creating a Key with the id instead of passing the ID
 directly?

 http://code.google.com/appengine/docs/java/javadoc/com/google/appengi...

 That is, try KeyFactory.createKey(myEntity.class.getName(), keyId);


I tried that out and received a

javax.jdo.JDOFatalUserException: Exception converting com.myclass
(agh0ZXN0NDcxM3IWCxIGV2luZXJ5GAEMCxIEV2luZRgCDA) to an internal key.
at
org.datanucleus.store.appengine.jdo.DatastoreJDOPersistenceManager.getObjectById
(DatastoreJDOPersistenceManager.java:66)
at org.datanucleus.jdo.JDOPersistenceManagerProxy.getObjectById
(JDOPersistenceManagerProxy.java:373)


thanks for your support

--

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: eclipse plugin and maven?

2009-12-15 Thread a.maza


On 14 Dez., 10:35, drone andr...@gmail.com wrote:

 I see now, that they can be found inhttp://www.mvnsearch.org/maven2/
 repository, so I will try updating maven-gae-plugin as soon as I have
 some free time.

Are you sure? I just checked that but I've found no appengine-related
libs there.

--

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] Retrieving an entity using a different key type than the key field in the class

2009-12-15 Thread a.maza
According to the documentation on
http://code.google.com/appengine/docs/java/datastore/creatinggettinganddeletingdata.html#Keys
it should be possible to retrieve an entity using a different key type
than the key field in the class.

Assuming the following entity having a key (encoded string) and a
keyId like

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

@Persistent
@Extension(vendorName=datanucleus, key=gae.pk-id,
value=true)
private Long keyId;

it should be possible to retrieve the entity by both

pm.getObjectById(myEntity.class, encodedKey);
and
pm.getObjectById(myEntity.class, keyId);

do I understand that correctly? - (since it does not work out for my
code)

thanks,
andr

--

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: Logging in JUnit tests

2009-12-13 Thread a.maza
         /
     /logger

     root
         level
             value=info
         /

         appender-ref
             ref=RootConsoleAppender
         /
     /root
 /configuration



 Philippe Marschall wrote:

  On Dec 12, 2:50 pm, a.maza andr.m...@gmail.com wrote:
  Hello,

  I have currently some troubles with logging in junit tests. In
  general, I have the following questions:

  -) According to the manuals, I could basically use any log framework
  which logs to System.out and System.err, respectively (e.g., log4j).
  However, for having a fine grained selection mechanism in the admin
  console, the use of java.util.logging (JUL) is required. Is this true,
  since the log levels of the admin console remind me rather to those of
  log4j than those of JUL.

  -) JUL logging works quite fine for running the web application on
  jetty. However, when doing junit tests, JUL does not automatically
  read the logging.properties from the file system resulting in logging
  INFO and above.
  I have learned that the logging.properties file can be set using the -
  Djava.util.logging.config.file jvm argument. However, doing this for
  every junit test is a little bit cumbersome. (i.e., not an option).
  Some websites state that setting a system property
  (java.util.logging.config.file) in the base test class may work - but
  not in my case.
  JUL would allow to read a logging.properties file from the filesystem
  using the LogManager class. However, the LogManager is a restricted
  class on GAE (also in the dev environment).

  I also thought about the option of using SLF4J with the JUL binding
  for the web application and SLF4J with a log4j binding for JUnit
  tests... but I am not sure if this works out

  Since SLF4J is just a facade it doesn't support any configuration.

   I would be happy to hear from others how they manage logging
  (especially in JUnit tests) or any suggestions that might help...

  I don't use JUL if I have a choice. With logback you can just add a
  logback-test.xml to src/test/resources and you're set. For JUL
  configuring argLine in the surefire plugin might be an option. You
  could also put a MethodRule or some setup method an abstract super
  class for all tests that set up JUL.

  Cheers
  Philippe

  --

  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 
  athttp://groups.google.com/group/google-appengine-java?hl=en.- Zitierten 
  Text ausblenden -

 - Zitierten Text anzeigen -

--

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: Logging in JUnit tests

2009-12-13 Thread a.maza
I just checked the DN docs and was able to answer this (dumb) question
myself.

DN's logging can be configured using its logging categories.

On 13 Dez., 11:34, a.maza andr.m...@gmail.com wrote:
 thanks for your help. using logback for everything through the slf4j
 bridges is really an improvement.

 I just a slight problem remaining:

 now datanucleus logs everything through

 org.datanucleus.util.Log4JLogger.debug.58: ...

 which does not allow for a fine-grained configuration. has anybody
 experienced the same problem and knows how to solve it?

 thanks

 On 12 Dez., 21:36, Rusty Wright rwright.li...@gmail.com wrote:



  I'm using slf4j and logback, and the slf4j adapters for jakarta commons 
  logging etc., that re-route things through slf4j.  Here's my maven 
  dependency pom so you can see what I'm using.  After that is my 
  logback.xml file (everything goes to the console).  If you're using maven, 
  be sure and do a mvn dependency:tree to make sure that you've 
  successfully excluded jakarta commons logging.

  ?xml version=1.0 encoding=ISO-8859-1 ?

  project
      xmlns=http://maven.apache.org/POM/4.0.0;
      xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
      xsi:schemaLocation=
         http://maven.apache.org/POM/4.0.0
         http://maven.apache.org/maven-v4_0_0.xsd;

      modelVersion4.0.0/modelVersion

      groupIdcom.objecteffects/groupId

      artifactIddependencies-logging/artifactId

      packagingpom/packaging

      namelogging dependencies/name

      version1.5.8/version

      descriptionlogging dependencies module/description

      !--
          with provided scope on commons logging you still need to
          explicitly exclude jakarta commons logging from each package
          that's using it. if you use the version 99.0-does-not-exist
          hack, it pulls in an empty jar file. so, in a way, the
          99.0-does-not-exist hack is safer, because you won't ever get
          the real jakarta commons logging jar included when you miss a
          package that needs the exclusion. but it adds an extra dependency.
      --
      dependencies
          dependency
              groupIdcommons-logging/groupId
              artifactIdcommons-logging/artifactId

              !-- use provided scope on real JCL instead --
              !-- version99.0-does-not-exist/version --

              version1.1.1/version

              scopeprovided/scope
          /dependency

          dependency
              groupIdcommons-logging/groupId
              artifactIdcommons-logging-api/artifactId

              !-- use provided scope on real JCL instead --
              !-- version99.0-does-not-exist/version --

              version1.1/version

              scopeprovided/scope
          /dependency

          !-- the slf4j commons-logging replacement --
          !-- if any package is using jakarta commons logging this will --
          !-- re-route it through slf4j. --
          dependency
              groupIdorg.slf4j/groupId
              artifactIdjcl-over-slf4j/artifactId

              version${version.slf4j}/version
          /dependency

          !-- the slf4j log4j replacement. --
          !-- if any package is using log4j this will re-route --
          !-- it through slf4j. --
          dependency
              groupIdorg.slf4j/groupId
              artifactIdlog4j-over-slf4j/artifactId

              version${version.slf4j}/version
          /dependency

          !-- the slf4j java.util.logging replacement. --
          !-- if any package is using jul this will re-route --
          !-- it through slf4j. --
          dependency
              groupIdorg.slf4j/groupId
              artifactIdjul-to-slf4j/artifactId

              version${version.slf4j}/version
          /dependency

          dependency
              groupIdorg.slf4j/groupId
              artifactIdslf4j-api/artifactId

              version${version.slf4j}/version
          /dependency

          dependency
              groupIdch.qos.logback/groupId
              artifactIdlogback-classic/artifactId

              version${version.logback}/version
          /dependency
      /dependencies

      properties
          version.logback0.9.15/version.logback
          version.slf4j1.5.8/version.slf4j
      /properties
  /project

  ?xml version=1.0 encoding=UTF-8?

  configuration debug=true
      appender class=ch.qos.logback.core.ConsoleAppender 
  name=RootConsoleAppender
          layout class=ch.qos.logback.classic.PatternLayout
              pattern%date{-MM-dd HH:mm:ss.SSS z}, %5level: [%thread] 
  %class.%method.%line: %message%n/pattern
          /layout
      /appender

      logger name=org.springframework.beans
          level
              value=warn
          /
      /logger

      logger name=org.springframework.transaction
          level
              value=debug
          /
      /logger

      logger name=org.springframework.orm.jdo.JdoTransactionManager

[appengine-java] Logging in JUnit tests

2009-12-12 Thread a.maza
Hello,

I have currently some troubles with logging in junit tests. In
general, I have the following questions:

-) According to the manuals, I could basically use any log framework
which logs to System.out and System.err, respectively (e.g., log4j).
However, for having a fine grained selection mechanism in the admin
console, the use of java.util.logging (JUL) is required. Is this true,
since the log levels of the admin console remind me rather to those of
log4j than those of JUL.

-) JUL logging works quite fine for running the web application on
jetty. However, when doing junit tests, JUL does not automatically
read the logging.properties from the file system resulting in logging
INFO and above.
I have learned that the logging.properties file can be set using the -
Djava.util.logging.config.file jvm argument. However, doing this for
every junit test is a little bit cumbersome. (i.e., not an option).
Some websites state that setting a system property
(java.util.logging.config.file) in the base test class may work - but
not in my case.
JUL would allow to read a logging.properties file from the filesystem
using the LogManager class. However, the LogManager is a restricted
class on GAE (also in the dev environment).

I also thought about the option of using SLF4J with the JUL binding
for the web application and SLF4J with a log4j binding for JUnit
tests... but I am not sure if this works out

 I would be happy to hear from others how they manage logging
(especially in JUnit tests) or any suggestions that might help...

--

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 object doesn't work anymore

2009-12-08 Thread a.maza
I am using Spring and OpenPersistenceManagerInView as well.

I experienced various problems. I am now using

pmf.getPersistenceManagerProxy() (instead of pmf.getPersistenceManager
()) and it works quite fine.

regards,
andreas

On 8 Dez., 17:30, tal tal.j@gmail.com wrote:
 I might be having the same problem.
 took me a while to find the consistency: i have 2 unrelated model
 classes (User and Category). creating or updating Category objects
 initially works, but when i read users from the datastore, creating
 and updating of Category stops working until I restart my server.
 I am using a different persistenceManager for each class, retrieved
 from a joint persistenceManagerFactory.

 was your problem resolved?

 On Nov 20, 1:47 am, randal rdgo...@gmail.com wrote:



  No not yet.- Zitierten Text ausblenden -

 - Zitierten Text anzeigen -

--

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: Text Search Support for Java

2009-12-06 Thread a.maza


On 4 Dez., 12:04, Raphael André Bauer raphael.andre.ba...@gmail.com
wrote:
 On Fri, Dec 4, 2009 at 11:46 AM, a.maza andr.m...@gmail.com wrote:
  regarding compass:
 1. Task queues do not work, because tasks might get executed in
 parallel what almost for sure messes up your index
 (http://forum.compass-project.org/message.jspa?messageID=299109#299109)

I just had another thought about (re-occuring) indexing:

Vince Bonfanti's Deferrable (see http://groups.google.com/group/
google-appengine-java/browse_thread/thread/6f736624cc820d5b/
48614355b12e9773?lnk=gstq=defer#48614355b12e9773) may be helpful

Regards,
andr

--

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: Spring MVC with annotations

2009-12-02 Thread a.maza
this is a known issue.. there are several threads in this forum about
it

http://groups.google.com/group/google-appengine-java/search?group=google-appengine-javaq=naming+exception



On 2 Dez., 12:33, Rafael Reuber psico.in...@gmail.com wrote:
 The log shows this:
 org.springframework.web.servlet.FrameworkServlet initServletBean:
 Context initialization failed
 org.springframework.beans.factory.BeanCreationException: Error
 creating bean with name
 'org.springframework.context.annotation.internalPersistenceAnnotationProces­sor':
 Initialization of bean failed; nested exception is
 java.lang.NoClassDefFoundError: javax/naming/NamingException

 On Dec 2, 12:44 am, Rusty Wright rwright.li...@gmail.com wrote:



  Is there anything helpful in the error log?  You can view it on the 
  dashboard;

 https://appengine.google.com/

  Rafael Reuber wrote:
   Hi Toby,

        The error only happens when I try to access the application
   through the GAE. It's funny, In my computer it work!
        The GAE throws erro, when I do deploy with  these tag
   context:component-scan base-package=br.com.project.controller /
   in my spring-context.xml

   On Nov 29, 11:23 am, Toby tobias.ro...@sunnymail.mobi wrote:
   Hi Rafael,

   What kind of error do you get, what annotations do you use?
   I used @Autowired and @Ressource and it worked fined. My main problem
   is that appengine unloads the webapp after short idle time. Whenever
   it is needed again it is reloaded which takes long and costs a lot of
   cpu time.  I found that stripping annotations accelerated the process.

   Cheers,
   Tobias

   On Nov 28, 9:31 pm, Rafael Reuber psico.in...@gmail.com wrote:

   I developed an program with Spring MVC + annotations. He done in my
   computer. But when I make deploy and try acess the application, the GAE
   throws an error. Someone got use annotations with Spring MVC?
   --
   Rafael Reuber
   MSN/Gtalk: psico.in...@gmail.com

   --

   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 
   athttp://groups.google.com/group/google-appengine-java?hl=en.- Zitierten 
   Text ausblenden -

 - Zitierten Text anzeigen -

--

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: Bi-directional unowned one-to-many relationships?

2009-11-13 Thread a.maza
but then it would be again an owned relationship, which I actually
wanted to avoid...



On 13 Nov., 06:33, Rusty Wright rwright.li...@gmail.com wrote:
 One of the things I've been wondering about is if it helps to invert the 
 ownership.

 Thinking out loud again.  Feedback welcome; feel free to point out flaws in 
 my logic, or whatever.

 For example, if you have a class Person with favorite foods, with an rdbms 
 you'd have:

 @PersistenceCapable(identityType = IdentityType.APPLICATION, detachable = 
 true)
 class Person {
     @PrimaryKey
     @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
     private Long id;

     @Persistent(defaultFetchGroup = true)
     private SetFavoriteFood favoriteFoods = new HashSetFavoriteFood();

     etc.

 }

 @PersistenceCapable(identityType = IdentityType.APPLICATION, detachable = 
 true)
 class FavoriteFood {
     @PrimaryKey
     @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
     private Long id;

     etc.

 }

 But with GAE's Big Table this doesn't work if you want to share the 
 FavoriteFood entities because when you add them to Person's favoriteFoods 
 collection it wants to make Person their parent.

 So with GAE what you could do is:

 @PersistenceCapable(identityType = IdentityType.APPLICATION, detachable = 
 true)
 class Person {
     @PrimaryKey
     @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
     @Extension(vendorName = datanucleus, key = gae.encoded-pk, value = 
 true)
     private String id;

     @Persistent(defaultFetchGroup = true)
     private SetString favoriteFoods = new HashSetString();

     etc.

 }

 @PersistenceCapable(identityType = IdentityType.APPLICATION, detachable = 
 true)
 class FavoriteFood {
     @PrimaryKey
     @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
     @Extension(vendorName = datanucleus, key = gae.encoded-pk, value = 
 true)
     private String id;

     etc.

 }

 And if a Person's favorite food is haggis, you'd do a query to get the haggis 
 entity, then store its id in the Person's favoriteFoods Set.  (And you could 
 use Key instead of String.)

 But what if you invert the relationship; make FavoriteFoods the aggregator; 
 so instead of people having a list of favorite foods, the favorite foods have 
 a list of people for whom they're their favorites:

 @PersistenceCapable(identityType = IdentityType.APPLICATION, detachable = 
 true)
 class Person {
     @PrimaryKey
     @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
     @Extension(vendorName = datanucleus, key = gae.encoded-pk, value = 
 true)
     private String id;

     etc.

 }

 @PersistenceCapable(identityType = IdentityType.APPLICATION, detachable = 
 true)
 class FavoriteFood {
     @PrimaryKey
     @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
     @Extension(vendorName = datanucleus, key = gae.encoded-pk, value = 
 true)
     private String id;

     @Persistent(defaultFetchGroup = true)
     private SetString persons = new HashSetString();

     etc.

 }

 I'm wondering if in some cases modeling things this way may make things 
 easier to manage.  For example, you may be able to store the object (instead 
 of its id) in the Set and let it become the child; perhaps the parenting 
 issues going in that direction are less irksome.



 James H wrote:
  This seems to be at the core of much confusion...hopefully one of the
  persistence experts will weigh in and enlighten us.  I keep watch on
  this thread and weigh in a bit later, in a rush at the moment!

  On Nov 11, 7:39 am, a.maza andr.m...@gmail.com wrote:
  I am thinking if it makes sense from a design perspektive to model
  unowned bi-directional one-to-many relationships.I did some search on
  the web but didn't find many thoughts about such type of relationship.

  The two entity types I have should not be in an owned relationship for
  some reasons. Thus, I was thinking about using the relation index
  pattern as presented at Google I/O (http://code.google.com/intl/de-AT/
  events/io/2009/sessions/BuildingScalableComplexApps.html)

  However, I am not fully happy with that as outlined in another thread
  (http://groups.google.com/group/google-appengine-java/browse_thread/
  thread/2bba41ce4699d65e/918fee627cc41e02?#918fee627cc41e02) mainly due
  to performance issues when iterating over the keys in memory.

  Thus I was thinking about modeling the two entities in an unowned bi-
  directional style implying that I have to update the two entities in
  separate transactions in order to keep the relationship between the
  two entities. I would like to hear your thoughts about this. My main
  concern is consistency when something goes wrong in one of the two
  transactions.

  thanks,
  andr
  --~--~-~--~~~---~--~~
  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

[appengine-java] Re: How to use picasa upload api on Google App Engine

2009-11-12 Thread a.maza
why are you not using another class that implements the MediaSource
interface - e.g., MediaByteSource or MediaStreamSource?

regards,
andr

On 11 Nov., 21:22, Ikai L (Google) ika...@google.com wrote:
 Kishore,

 Here are the docs related to sending the data as 
 binary:http://code.google.com/apis/picasaweb/docs/2.0/developers_guide_proto...

 This is the raw protocol. Here are the steps you'll have to take:

 1. Accept a file upload and buffer it in memory 
 (http://code.google.com/appengine/kb/java.html#fileforms)
 2. Format the authorization headers and POST body as necessary
 3. Open an HTTP connection using 
 URLFetch:http://code.google.com/appengine/docs/java/urlfetch/overview.html(Note
  the
 limits)

 You'll need to do some research into the exact format for uploads to the
 Picasa API. I don't have any code samples for doing this, but it looks very
 similar to standard HTTP multipart form data with XML metadata.

 On Tue, Nov 10, 2009 at 8:36 PM, Kishore Jaladi 
 kishorejal...@gmail.comwrote:







  Hi Ikai,
  Thanks for the response.
  The protocol section describes format of the post body. But the Java
  guide does not explain how to send binary image data other than teh
  approach of creating MediaFileSource with the java.io.File as refered
  at
 http://code.google.com/apis/picasaweb/docs/2.0/developers_guide_java
  .
  And Java GAE does not support new File(/home/liz/puppies.jpg)
  snippet of this sample. Can you please give me a sample or refer to a
  doc that explains how the other approach (sending binary image data)
  works in jsp/java world?

  Thanks in advance
  - Kishore

  On Nov 10, 5:58 pm, Ikai L (Google) ika...@google.com wrote:
   You may want to look here:

  http://code.google.com/apis/picasaweb/docs/2.0/developers_guide_proto...

   If you are looking to upload photos that a user has uploaded, you will
  not
   be able to save the image in the file system. You'll have to buffer the
  data
   in memory and post to Picasa's API.

   On Sun, Nov 8, 2009 at 10:43 PM, Kishore Jaladi kishorejal...@gmail.com
  wrote:

Hi,
Is there a way to upload files on local file system to picasa on
google app Engine? The google app engine cannot read local files. I
tried to use GAEVFS (Virtual File system), but I could not figure out
how to create MediaFileSource from FileObject. Any help please?

- kjaladi

   --
   Ikai Lan
   Developer Programs Engineer, Google App Engine

 --
 Ikai Lan
 Developer Programs Engineer, Google App Engine- Zitierten Text ausblenden -

 - Zitierten Text anzeigen -

--

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




[appengine-java] Re: Paging in java application

2009-11-12 Thread a.maza
I think this may help you

http://code.google.com/p/gae-query-pager/



On 11 Nov., 18:50, Sanjith Chungath csanj...@gmail.com wrote:
 Greetings to All,
               I found this 
 documentationhttp://code.google.com/appengine/articles/paging.htmlon paging 
 in python.
 Can some one suggest the best way to implement pagin in a java application
 deployed in GAE and data store in GAE data store. I want to show say 10
 images in every page out of around 1000 (available in DB).

 Also please let me know any widgets available to implement pagination.

 -Sanjith

--

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




[appengine-java] duplicate jdoconfig.xml due to unit testing (eclipse)

2009-11-12 Thread a.maza
hello,

my GAE project in eclipse has the following structure (maven-like)

*) src/main contains my application - it is comiled to war/WEB-INF/
classes
*) src/test contain my junit tests - it is compiled to target/test

in both source folders (src/main and src/test) I have a META-INF
folder with a jdoconfig.xml, since I am using a different config for
the unit tests.

When running the junit tests, I get a JDOFatalUserException since
there is a duplicate PMF with the same name. Consequently, when
running the junit tests it seems to load the jdoconfig from both
locations -  war/WEB-INF/classes and  target/test.

Has anybody experienced similar problems and a solution or workaround
for that?


Thanks and regards,
andr

--

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




[appengine-java] Re: trouble with SDK 1.2.6

2009-11-12 Thread a.maza
same here, when I try to have my junit tests in the same project.
anyone got a solution?

On 28 Okt., 18:22, Vince Bonfanti vbonfa...@gmail.com wrote:
 No, that didn't help. Again, just to make sure I'm being clear:

  - The only reason appengine-api-stubs.jar and
 appengine-local-runtime.jar are in my project classpath is to be able
 to compile my junit tests. They're not needed for debugging my
 project. However...

  - When creating a debug configuration, Eclipse automatically uses the
 project classpath by default, which causes the exceptions I showed
 earlier when trying to debug. Adding appengine-agent.jar to the top of
 the project and debug classpaths did not solve the problem.

  - By manually editing my debug configuration to remove
 appengine-api-stubs.jar and appengine-local-runtime.jar from the debug
 classpath, everything works fine.

 At this point I'm happy.

 Vince



 On Fri, Oct 23, 2009 at 3:55 PM, Toby Reyelts to...@google.com wrote:
  Vince,

  You should be able to workaround the problem you're having with your unit
  tests by adding $SDK/lib/agent/appengine-agent.jar to the very top of your
  system classpath. Please let me know if that does not work for you.

  On Fri, Oct 23, 2009 at 3:23 PM, Vince Bonfanti vbonfa...@gmail.com wrote:

  It looks like the Eclipse debug configuration automatically picks up
  the complete build path for the project as its classpath. Manually
  editing the debug configuration to remove appengine-api-stubs.jar and
  appengine-local-runtime.jar from the classpath fixes the problem.

  Vince

  On Fri, Oct 23, 2009 at 3:01 PM, Vince Bonfanti vbonfa...@gmail.com
  wrote:

   I just figured out the problem. I had added appengine-api-stubs.jar
   and appengine-local-runtime.jar to my project build path to support
   junit testing. Upgrading to the 1.2.6 versions only changed the error
   message, but removing them from the build path solved the problem. Now
   I just have to figure out how to configure things properly to support
   junit testing...

   Thanks.

   Vince

   2009/10/23 Miguel Méndez mmen...@google.com:
   I'm going to check and see if I can reproduce this using your project.- 
   Zitierten Text ausblenden -

 - Zitierten Text anzeigen -

--

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




[appengine-java] Re: Jdo: detaching objects vs. merging transient objects

2009-11-11 Thread a.maza

thanks for your answers:

Pierre, the StreamingQueryResult is not serializable. However, to my
understanding this problem is alleviated when you work with detached
objects since you call something like

Collection c = pm.detachCopyAll(resultList);

at the end and you are then returning the instance c

Rusty, I am creating a wicket-based application from scratch. At the
beginning I included spring for dependency injection, transactions,
and open session in view behavior. However, I got rid of spring since
its behavior in terms of transactions is mosty not required on GAE and
also sometimes not completely clear to me. OSIV is nice, but I trying
to do that by means of wicket only (if required since we don't work
with so many tables as in web application having relational
datastores. without spring I am currently not experiencing big
problems with detached objects.

regards,
andr


On 10 Nov., 22:54, Rusty Wright rwright.li...@gmail.com wrote:
 I'm finding that it's nearly impossible to work with the detaching objects 
 style.  I can't tell for sure what's happening other than when I add a 
 PersistenceCapable object to another PersistenceCapable object's collection 
 (i.e., the first one will be the child of the second one) that I get an error 
 about trying to persist objects in different entity groups in the same 
 transaction.

 I'm using Spring and subclassing JdoDaoSupport and the transactions are 
 handled for me; I'm not sure if that's part of the problem.  With 
 JdoDaoSupport I never need to open or close the persistence manager or start 
 and commit transactions, although I do have an xml file that does the aop 
 proxy wrapping of my classes.



 a.mazawrote:
  I've used the merging of transient objects approach for a while as
  described 
  inhttp://timepedia.blogspot.com/2009/04/google-appengine-and-gwt-now-ma...
  and it works quite fine. I only subsituted the proposed implementation
  of copying fields by dozer.

  However, I am still thinking to move to the detaching objects
  approach and played around with it a bit. So far, the detaching
  objects approachs seems more cumbersome to me...

  I would be happy to hear some thoughts...

  regards,
  andr- Zitierten Text ausblenden -

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



[appengine-java] Bi-directional unowned one-to-many relationships?

2009-11-11 Thread a.maza

I am thinking if it makes sense from a design perspektive to model
unowned bi-directional one-to-many relationships.I did some search on
the web but didn't find many thoughts about such type of relationship.

The two entity types I have should not be in an owned relationship for
some reasons. Thus, I was thinking about using the relation index
pattern as presented at Google I/O (http://code.google.com/intl/de-AT/
events/io/2009/sessions/BuildingScalableComplexApps.html)

However, I am not fully happy with that as outlined in another thread
(http://groups.google.com/group/google-appengine-java/browse_thread/
thread/2bba41ce4699d65e/918fee627cc41e02?#918fee627cc41e02) mainly due
to performance issues when iterating over the keys in memory.

Thus I was thinking about modeling the two entities in an unowned bi-
directional style implying that I have to update the two entities in
separate transactions in order to keep the relationship between the
two entities. I would like to hear your thoughts about this. My main
concern is consistency when something goes wrong in one of the two
transactions.

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



[appengine-java] Jdo: detaching objects vs. merging transient objects

2009-11-04 Thread a.maza

I've used the merging of transient objects approach for a while as
described in 
http://timepedia.blogspot.com/2009/04/google-appengine-and-gwt-now-marriage.html
and it works quite fine. I only subsituted the proposed implementation
of copying fields by dozer.

However, I am still thinking to move to the detaching objects
approach and played around with it a bit. So far, the detaching
objects approachs seems more cumbersome to me...

I would be happy to hear some thoughts...

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



[appengine-java] Re: AccessControlException (SerializablePermission enableSubclassImplementation) - Wicket on GAE

2009-10-22 Thread a.maza

I'll be happy to share the code as soon as it is running smoothly and
I got rid of the above mentioned AccessControlException.

Thus, I hope somebody could give me a hint what is causing the
exception.

Regards,
andr


On 21 Okt., 23:14, Esteban Masoero emaso...@getsense.com.ar wrote:
 a.maza:

 That's correct, I'm using HTTPSessionStore because of the filesystem
 writing restriction. However, I'm interested in the implementation you
 are trying to do, so if you decide to share it with the community when
 it's done, I'll be happy to give it a try ;). Moreover, we have a
 fileupload gae-like implementation that uses the datastore instead of
 the file system to store temporary recently uploaded files (shared by a
 developer in the wicket users list), so I'd be interested in merging our
 code and your code into some wicket-gae.jar extension, so everything its
 located at one place and can be reused by others.

 For the record, we haven't experienced any issues related to the
 back/foward button behavior (although I must tell that our app is still
 a small one and maybe that has something to do with it).

 Regards,

 Esteban

 a.maza escribió:





  On 21 Okt., 20:26, Esteban Masoero emaso...@getsense.com.ar wrote:

  Hi there:

  We've been running a wicket app on gae since last month, but without the
  need of implement memcache-based implementation of Wicket's IPageStore.
  Why are you doing that? (our wicket version is 1.3.7)

  Wicket is very powerful in maintaining application/session state. This
  enables for example a nice usage of back/forward buttons. In a typical
  scenario, this is backed by the DiskPageStore implementation. On GAE
  you can't use the DiskPageStore since it relies on writing to the
  filesystem. Thus, I assume that you use the HTTPSessionStore as
  proposed in some blog entries (and not the SecondLevelCacheStore).

  I did some research on the web and several users reported problems
  using the HTTPSessionStore - especially regarding the back/forward
  button behavior. Thus, I am currently trying to implement a Memcache-
  backed IPagestore for GAE. On the Wicket mailinglist I was provided
  with a HTTP session based implementation of IPageStore (done in the
  Terracotta project) to have a starting point (http://www.nabble.com/
  Google-App-Engine-and-Wicket-to23001592.html)- Zitierten Text ausblenden -

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



[appengine-java] Re: having problems with JDO query serialization to memcache...

2009-10-21 Thread a.maza

thanks jason for clarifying this. just to be sure since Larry's class
carries the detachable=true annotation:

keep detachable memcached objects their ability to be re-attached
later on?

thanks,
andr


On 21 Okt., 18:22, Larry Cable larry.ca...@gmail.com wrote:
 cheers ... makes sense!

 On Oct 20, 2:05 pm, Jason (Google) apija...@google.com wrote:



  No. The StreamingQueryResult class, which is a List used by DataNucleus to
  store query results, does not implement Serializable which is required for
  all objects stored in memcache. But you can create another List, i.e. an
  ArrayList, copy the (serializable) results into it, and cache this. You'll
  also need to do this if you want to send query results over the wire to a
  GWT-based application, for example.
  - Jason

  On Mon, Oct 19, 2009 at 2:03 PM, Larry Cable larry.ca...@gmail.com wrote:

   quick question: should I be able to directly serialize (Cache.put
   (...)) results of JDO queries into Memcache?

   It appears not ...

   I have the following class(es):

   @PersistenceCapable(identityType=IdentityType.APPLICATION,
   objectIdClass=CityState.CityStateKey.class, cacheable=true,
   detachable=true)
   public class CityState implements Serializable {
          public static class CityStateKey implements Serializable {

                 �...@notpersistent
                  private static Pattern p =
   Pattern.compile(^(.*),\\s?([A-Za-z]{2})
   $);

                  public CityStateKey() { }

                  public CityStateKey(String keyValue) {
                          final Matcher m = p.matcher(keyValue.trim());
                          if (m.matches()) {
                                  city  = m.group(1);
                                  state = State.valueOf((m.group(2))).name();
                          } else
                                          throw new
   IllegalArgumentException(keyValue);
                  }

                  /* (non-Javadoc)
                   * @see java.lang.Object#hashCode()
                   */
                 �...@override
                  public int hashCode() {
                      // elided ...
                  }

                  /* (non-Javadoc)
                   * @see java.lang.Object#equals(java.lang.Object)
                   */
                 �...@override
                  public boolean equals(Object obj) {
                                      // elided...
                  }

                  public String toString() { return (city + 
   Address.COMMASPACE
   +
   state); }

                  public String            state;
                  public String            city;
          }

          public CityState(final String city, final String state) {
                  this.city  = city.trim();
                  this.state = state;
          }

         �...@override
          public String getCity() {
                  return city;
          }

         �...@override
          public String getState() {
                  return state;
          }

          /* (non-Javadoc)
           * @see java.lang.Object#hashCode()
           */
         �...@override
          public int hashCode() {
                       // elided...
          }

          /* (non-Javadoc)
           * @see java.lang.Object#equals(java.lang.Object)
           */
         �...@override
          public boolean equals(Object obj) {
                      // elided...
          }

         �...@override
          public String toString() { return city + Address.COMMASPACE +
   state; }

         �...@persistent(primaryKey=true) public String state; // should be
   State GAE/JDO does not support...
         �...@persistent(primaryKey=true) public String city;
   }

   when I query select from CityState via JDO I get a
   StreamingQueryResult ...

   if I attempt to put that as a value into memcache I get the typical
   NotSerializableException indicating that
   an object in the graph is not serializable ...

   any thoughts/suggestions, clearly the (simple) app domain objects are
   (both) serializable as are the
   internal fields ...

   Thanks- Hide quoted text -

  - Show quoted text -- Zitierten Text ausblenden -

 - Zitierten Text anzeigen -

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