Re: Wicket GAE performance

2010-04-09 Thread Anton Veretennikov
I would like to comment that Objectify's documentation is very descriptive
about GAE Datastore - the art of writing good docs.
And i've started to use it very fast, thank you guys!

wicket-gae-template is a nice start point for wicket apps on gae using maven
http://code.google.com/p/wicket-gae-template/


-- Tony

On Thu, Apr 8, 2010 at 11:13 PM, Anton Veretennikov 
anton.veretenni...@gmail.com wrote:

 Very interesting, Jake, thank you, i'll look into it.
 I think i'm solving my problem just trying to modify the status of object
 inside a transaction - at the end it is throwing an exception that it can't
 commit. I'm testing if it really doing what i need.

 -- Tony


 On Wed, Apr 7, 2010 at 8:59 PM, jbrookover jbrooko...@cast.org wrote:


 Finally!  I've found others who are looking into Wicket on GAE.  :)

 Something else to look into, that is frequently mentioned on the GAE/J
 lists
 but not here, is Objectify - a very thin layer over the GAE datastore.  I
 was using JDO, PMF, etc and found Objectify to be a pretty easy switch.
 Also, in the process, I discovered several cases where JDO features were
 not implemented as I thought.  For example, I thought I could use JDO
 transactions to prevent race conditions in a case where two users were
 trying to create identical objects (when I only wanted one).  It turns out
 that may not be the case and I would need to manage the lock/permissions
 myself.

 See:

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

 Glad to find other GAE/Wicket users!

 Jake


 intmanch wrote:
 
  Hi all,
 
I've been actively using wicket on GAE for quite a lot of months
 and
  I
  love it, but I've quite serious performance problems. I already checked
  all
  the advices to speed up the performance but still is quite slow
 specially
  for some requests or opening a bookmarkable page. I don't know what to
 do,
  I
  use DataView, that it's quite performant, LoadableDetachableModels
  everywhere, session is ok in size, so I don't know if there is something
 I
  can tune on the RequestCycle servlet?
 
Thanks!
 
 

 --
 View this message in context:
 http://old.nabble.com/Wicket-GAE-performance-tp28118591p28164599.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org





Re: Wicket GAE performance

2010-04-08 Thread Anton Veretennikov
Very interesting, Jake, thank you, i'll look into it.
I think i'm solving my problem just trying to modify the status of object
inside a transaction - at the end it is throwing an exception that it can't
commit. I'm testing if it really doing what i need.

-- Tony

On Wed, Apr 7, 2010 at 8:59 PM, jbrookover jbrooko...@cast.org wrote:


 Finally!  I've found others who are looking into Wicket on GAE.  :)

 Something else to look into, that is frequently mentioned on the GAE/J
 lists
 but not here, is Objectify - a very thin layer over the GAE datastore.  I
 was using JDO, PMF, etc and found Objectify to be a pretty easy switch.
 Also, in the process, I discovered several cases where JDO features were
 not implemented as I thought.  For example, I thought I could use JDO
 transactions to prevent race conditions in a case where two users were
 trying to create identical objects (when I only wanted one).  It turns out
 that may not be the case and I would need to manage the lock/permissions
 myself.

 See:

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

 Glad to find other GAE/Wicket users!

 Jake


 intmanch wrote:
 
  Hi all,
 
I've been actively using wicket on GAE for quite a lot of months
 and
  I
  love it, but I've quite serious performance problems. I already checked
  all
  the advices to speed up the performance but still is quite slow specially
  for some requests or opening a bookmarkable page. I don't know what to
 do,
  I
  use DataView, that it's quite performant, LoadableDetachableModels
  everywhere, session is ok in size, so I don't know if there is something
 I
  can tune on the RequestCycle servlet?
 
Thanks!
 
 

 --
 View this message in context:
 http://old.nabble.com/Wicket-GAE-performance-tp28118591p28164599.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org




Re: Wicket GAE performance

2010-04-07 Thread jbrookover

Finally!  I've found others who are looking into Wicket on GAE.  :)

Something else to look into, that is frequently mentioned on the GAE/J lists
but not here, is Objectify - a very thin layer over the GAE datastore.  I
was using JDO, PMF, etc and found Objectify to be a pretty easy switch. 
Also, in the process, I discovered several cases where JDO features were
not implemented as I thought.  For example, I thought I could use JDO
transactions to prevent race conditions in a case where two users were
trying to create identical objects (when I only wanted one).  It turns out
that may not be the case and I would need to manage the lock/permissions
myself.

See:
http://groups.google.com/group/objectify-appengine/browse_thread/thread/d71889d94ebf8302

Glad to find other GAE/Wicket users!

Jake


intmanch wrote:
 
 Hi all,
 
   I've been actively using wicket on GAE for quite a lot of months and
 I
 love it, but I've quite serious performance problems. I already checked
 all
 the advices to speed up the performance but still is quite slow specially
 for some requests or opening a bookmarkable page. I don't know what to do,
 I
 use DataView, that it's quite performant, LoadableDetachableModels
 everywhere, session is ok in size, so I don't know if there is something I
 can tune on the RequestCycle servlet?
 
   Thanks!
 
 

-- 
View this message in context: 
http://old.nabble.com/Wicket-GAE-performance-tp28118591p28164599.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Wicket GAE performance

2010-04-06 Thread Anton Veretennikov
Thank you very much, Ian, you clarified some things to me.

I'm trying to block some entity got for processing by one session from other
possibly concurrent session.
I know what i would do if it were RDBMS: lock my object with FOR UPDATE,
if success, i would check if status field is still what i assume it must be
and then update it to new status.

But i'm not sure yet how to do this in GAE.

-- Tony

On Tue, Apr 6, 2010 at 12:06 AM, Ian Marshall ianmarshall...@gmail.comwrote:


 Hello Tony,



 Anton Veretennikov wrote:
 
  This is a transaction of every session?
 

 I believe that there is some pooling of at least one of
 PersistenceManager[s] (PM[s]) and Transaction[s] (TX[s]). Nevertheless, the
 code extract I provided will yield a PM and TX unique to the thread (and
 therefore the request too in GAE/J) running that code. Your PM and TX will
 not leak to another request. I believe that the PersistenceManagerFactory
 (PMF) ensures this (if I am wrong, will someone please correct me).



 Anton Veretennikov wrote:
 
  If no, how may i handle this situation:
 
  When one user is accessing a page i must return data from one entity from
  the datastore, then close it from returning to any other users. What can
  be
  done here?
 
 Do you ask here How do I ensure that a user cannot see data 'belonging' to
 another user?

 Of course, your code will controls what data you exchange with the GAE
 datastore, so if it already ensures that some persistent entities are to be
 accessed by a specific user only, then this should continue. A different
 user calling your persistence code will have a different PM and TX; your
 user-specific data exchange should continue to be user-specific.

 Just ensure that the PMF is global to your Wicket application instance (a
 singleton only is required), and that your data exchange code gets, uses
 and
 closes PMs (using this PMF instance) as and when needed. As for
 transactions, the combination of what data exchange you perform, your JDO
 settings, and the GAE/J and DataNucleus documentation will determine
 whether
 you need to use a transaction.

 If I have not addressed your question Tony, would you please be so kind as
 to re-phrase it?

 Regards,

 Ian
 --
 View this message in context:
 http://old.nabble.com/Wicket-GAE-performance-tp28118591p28141583.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org




Wicket GAE performance

2010-04-06 Thread Ian Marshall

Hi Tony,

I presume that you have studied the GAE/J documentation about datastore
transactions at

 
http://code.google.com/intl/en/appengine/docs/java/datastore/transactions.html;.


In particular, I note:

JDO performs all actions between the call to tx.begin() and the call to
tx.commit() in a single transaction. If any action fails due to the
requested entity group being in use by another process, JDO throws a
JDODataStoreException or a JDOException, cause by a
java.util.ConcurrentModificationException.


In essence, let the JDO transaction do all the work for you! This should
help you in the case where a maximum of one thread (= request) only is
allowed to update persistent data at any time. All you will need to do then
(apart from thinking though your design) is to handle the exceptions
mentioned properly.

Cheers,

Ian


Anton Veretennikov wrote:
 
 Thank you very much, Ian, you clarified some things to me.
 
 I'm trying to block some entity got for processing by one session from
 other
 possibly concurrent session.
 I know what i would do if it were RDBMS: lock my object with FOR UPDATE,
 if success, i would check if status field is still what i assume it must
 be
 and then update it to new status.
 
 But i'm not sure yet how to do this in GAE.
 
 -- Tony
 
-- 
View this message in context: 
http://old.nabble.com/Wicket-GAE-performance-tp28118591p28149943.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Wicket GAE performance

2010-04-05 Thread Ian Marshall

Hello Tony,



Anton Veretennikov wrote:
 
 This is a transaction of every session?
 

I believe that there is some pooling of at least one of
PersistenceManager[s] (PM[s]) and Transaction[s] (TX[s]). Nevertheless, the
code extract I provided will yield a PM and TX unique to the thread (and
therefore the request too in GAE/J) running that code. Your PM and TX will
not leak to another request. I believe that the PersistenceManagerFactory
(PMF) ensures this (if I am wrong, will someone please correct me).



Anton Veretennikov wrote:
 
 If no, how may i handle this situation:
 
 When one user is accessing a page i must return data from one entity from
 the datastore, then close it from returning to any other users. What can
 be
 done here?
 
Do you ask here How do I ensure that a user cannot see data 'belonging' to
another user?

Of course, your code will controls what data you exchange with the GAE
datastore, so if it already ensures that some persistent entities are to be
accessed by a specific user only, then this should continue. A different
user calling your persistence code will have a different PM and TX; your
user-specific data exchange should continue to be user-specific.

Just ensure that the PMF is global to your Wicket application instance (a
singleton only is required), and that your data exchange code gets, uses and
closes PMs (using this PMF instance) as and when needed. As for
transactions, the combination of what data exchange you perform, your JDO
settings, and the GAE/J and DataNucleus documentation will determine whether
you need to use a transaction.

If I have not addressed your question Tony, would you please be so kind as
to re-phrase it?

Regards,

Ian
-- 
View this message in context: 
http://old.nabble.com/Wicket-GAE-performance-tp28118591p28141583.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Wicket GAE performance

2010-04-04 Thread Ian Marshall

I have a static initialisation method and two static data members as follows:

  public class DataExchange
  {
private static final Object objLockPMF = new Object();
private static volatile PersistenceManagerFactory g_pmf = null;
  
/**
 * If this class's static singleton
codePersistenceManagerFactory/code
 * is codenull/code, then construct it in a synchronised block of
code.
 * @return
 *   This class's static singleton
codePersistenceManagerFactory/code.
 */
public static PersistenceManagerFactory getPersistenceManagerFactory()
{
  if (g_pmf == null)
synchronized(objLockPMF)
{
  if (g_pmf == null)
  {
loadProperties();// My method which loads the string
g_sDatabaseMode
g_pmf = JDOHelper.getPersistenceManagerFactory(g_sDatabaseMode);
  }
}
  
  return g_pmf;
}
  }


I then call the above static method when my Wicket application initiates by
creating a queued task which calls this method fairly immediately but
asynchronously. I ensure that my home page performs no data exchange, so
creating the PMF does not delay the showing of the first page.

I also call the above static method at the start of every data exchange.
There will be nothing to construct unless the queued task has not yet
finished or GAE has shut the relevant Wicket application instance down. For
example (which will not be a surprise) when using a transaction:

  PersistenceManager pm =
   DataExchange.getPersistenceManagerFactory().getPersistenceManager();
  Transaction tx = pm.currentTransaction();

  try
  {
tx.begin();

//
// Persistence code
//

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


Enjoy,

Ian



intmanch wrote:
 
 Hi Ian,
 
 Thanks a lot for your response. I use as you PMF, not JPA, that's quite
 simple and easy to use. Can you give me more details (code snippet) about
 the initialization of the PMF? Is there any other point to take into
 consideration for the performance?
 
-- 
View this message in context: 
http://old.nabble.com/Wicket-GAE-performance-tp28118591p28133464.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Wicket GAE performance

2010-04-04 Thread Anton Veretennikov
Hello, i'm working with GAE too, may i clarify something?

Transaction tx = pm.currentTransaction();

This is a transaction of every session?
If no, how may i handle this situation:

When one user is accessing a page i must return data from one entity from
the datastore, then close it from returning to any other users. What can be
done here?

-- Tony.



On Mon, Apr 5, 2010 at 12:08 AM, Ian Marshall ianmarshall...@gmail.comwrote:


 I have a static initialisation method and two static data members as
 follows:

  public class DataExchange
  {
private static final Object objLockPMF = new Object();
private static volatile PersistenceManagerFactory g_pmf = null;

/**
 * If this class's static singleton
 codePersistenceManagerFactory/code
 * is codenull/code, then construct it in a synchronised block of
 code.
 * @return
 *   This class's static singleton
 codePersistenceManagerFactory/code.
 */
public static PersistenceManagerFactory getPersistenceManagerFactory()
{
  if (g_pmf == null)
synchronized(objLockPMF)
{
  if (g_pmf == null)
  {
loadProperties();// My method which loads the string
 g_sDatabaseMode
g_pmf = JDOHelper.getPersistenceManagerFactory(g_sDatabaseMode);
  }
}

  return g_pmf;
}
  }


 I then call the above static method when my Wicket application initiates by
 creating a queued task which calls this method fairly immediately but
 asynchronously. I ensure that my home page performs no data exchange, so
 creating the PMF does not delay the showing of the first page.

 I also call the above static method at the start of every data exchange.
 There will be nothing to construct unless the queued task has not yet
 finished or GAE has shut the relevant Wicket application instance down. For
 example (which will not be a surprise) when using a transaction:

  PersistenceManager pm =
   DataExchange.getPersistenceManagerFactory().getPersistenceManager();
  Transaction tx = pm.currentTransaction();

  try
  {
tx.begin();

//
// Persistence code
//

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


 Enjoy,

 Ian



 intmanch wrote:
 
  Hi Ian,
 
  Thanks a lot for your response. I use as you PMF, not JPA, that's quite
  simple and easy to use. Can you give me more details (code snippet) about
  the initialization of the PMF? Is there any other point to take into
  consideration for the performance?
 
 --
 View this message in context:
 http://old.nabble.com/Wicket-GAE-performance-tp28118591p28133464.html
 Sent from the Wicket - User mailing list archive at Nabble.com.


 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org




Re: Wicket GAE performance

2010-04-03 Thread intmanch

Hi Ian, 

Thanks a lot for your response. I use as you PMF, not JPA, that's quite
simple and easy to use. Can you give me more details (code snippet) about
the initialization of the PMF? Is there any other point to take into
consideration for the performance? 


Ian Marshall wrote:
 
 A quick afternote: in my previous post, I assumed that you were using
 persistence via JDO code (using PMF).
 
 I don't know how long it takes to construct any equivalent datastore
 connection using JPA or the GAE/J persistence API.
 

-- 
View this message in context: 
http://old.nabble.com/Wicket-GAE-performance-tp28118591p28125679.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Wicket GAE performance

2010-04-02 Thread Alejandro
Hi all,

  I've been actively using wicket on GAE for quite a lot of months and I
love it, but I've quite serious performance problems. I already checked all
the advices to speed up the performance but still is quite slow specially
for some requests or opening a bookmarkable page. I don't know what to do, I
use DataView, that it's quite performant, LoadableDetachableModels
everywhere, session is ok in size, so I don't know if there is something I
can tune on the RequestCycle servlet?

  Thanks!


Wicket GAE performance

2010-04-02 Thread Ian Marshall

Hello there,

I delegate the construction of my singleton PersistenceManagerFactory (PMF)
(for data exchange with the datastore) to a queued task, since this
operation can take a few seconds. This way, my home page can show without
waiting for PMF construction to be complete.

I know that the first request to a GAE server will require the starting of a
new JVM (and Wicket application instance) and can take many seconds to be
served. If a Wicket application instance receives no request for a while
then the JVM can be shut down. I think that stuff may be serialised to
persistent storage since data in my Wicket sessions survives such JVM
shut-downs. Anyway, I know that some people create cron jobs or queued tasks
to poke the web application regularly, in order to stop the JVM shutting
down and to maintain the fast serving of web pages.

Is this any help?


intmanch wrote:
 
 I've been actively using wicket on GAE for quite a lot of months and I
 love it, but I've quite serious performance problems. I already checked
 all
 the advices to speed up the performance but still is quite slow specially
 for some requests or opening a bookmarkable page.
 
-- 
View this message in context: 
http://old.nabble.com/Wicket-GAE-performance-tp28118591p28119597.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Wicket GAE performance

2010-04-02 Thread Ian Marshall

A quick afternote: in my previous post, I assumed that you were using
persistence via JDO code (using PMF).

I don't know how long it takes to construct any equivalent datastore
connection using JPA or the GAE/J persistence API.
-- 
View this message in context: 
http://old.nabble.com/Wicket-GAE-performance-tp28118591p28122983.html
Sent from the Wicket - User mailing list archive at Nabble.com.


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Wicket GAE Performance

2009-10-28 Thread Alexander Elsholz
Hi,

i dont have any profiler. the problem is, that the application is slow when
running on googles application engine. local, where i could profile aeverything
is fine.
where ist the best place in wicket to hoock performance measures? or are there
any debug-messages which i could activate?

thanka alex





-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Wicket GAE Performance

2009-10-27 Thread Alexander Elsholz
Hi,

we build a wicket-application, running in gae - all works fine. but when
deploying on gae-environment the performance is terrible (tried development and
deploymentmode). an ajax-call takes more than 3 secounds. i logged all
database-queries - no problem there. we lost time anywhere in
wicket-request-cycle. had anyone simelar problems and solved them?

thanks a lot alex


-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Re: Wicket GAE Performance

2009-10-27 Thread Pedro Santos
What profiler is telling you? I had performance problem on file system file
access, and solve it removing this time consuming task from the
wicket-request-cycle thread

On Tue, Oct 27, 2009 at 5:36 PM, Alexander Elsholz 
alexander.elsh...@widas.de wrote:

 Hi,

 we build a wicket-application, running in gae - all works fine. but when
 deploying on gae-environment the performance is terrible (tried development
 and
 deploymentmode). an ajax-call takes more than 3 secounds. i logged all
 database-queries - no problem there. we lost time anywhere in
 wicket-request-cycle. had anyone simelar problems and solved them?

 thanks a lot alex


 -
 To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
 For additional commands, e-mail: users-h...@wicket.apache.org




-- 
Pedro Henrique Oliveira dos Santos