Re: [appengine-java] Re: Netbeans support

2011-07-18 Thread Liang Ding
Hi,

You can have a look at maven-gae-plugin:
http://code.google.com/p/maven-gae-plugin/,
and here  is a real-world project with
NetBeans IDE, GAE/J and Maven.

On Tue, Jul 19, 2011 at 2:27 PM, Ian Marshall wrote:

> Have you looked at
>
>
>
> http://code.google.com/p/googleappengine/issues/detail?id=1294&can=5&sort=priority%20-status&colspec=ID%20Type%20Component%20Status%20Stars%20Summary%20Language%20Priority%20Owner%20Log
>
> Regards,
>
> Ian
>
>
> On Jul 17, 5:26 pm, Pascal Emile Fares 
> wrote:
> > Hello,
> >
> > why there is no Netbeans support?
> >
> > Who is like me wich to have support for Netbeans like in Eclipse
> >
> > Regards
>
> --
> 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.
>
>


-- 
My Blog: http://88250.b3log.org

Open Source, Open Mind, Open Sight, Open Future!

-- 
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: Netbeans support

2011-07-18 Thread Ian Marshall
Have you looked at

 
http://code.google.com/p/googleappengine/issues/detail?id=1294&can=5&sort=priority%20-status&colspec=ID%20Type%20Component%20Status%20Stars%20Summary%20Language%20Priority%20Owner%20Log

Regards,

Ian


On Jul 17, 5:26 pm, Pascal Emile Fares 
wrote:
> Hello,
>
> why there is no Netbeans support?
>
> Who is like me wich to have support for Netbeans like in Eclipse
>
> Regards

-- 
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: does Google+ use GAE ?

2011-07-18 Thread Didier Durand
Hi,

J. Smarr, tech lead for G+,  says: "Our backends are built mostly on
top of BigTable and Colossus/GFS" in this short description of Google+
insfrastructure: 
http://www.quora.com/Can-someone-provide-some-information-about-Google+-infrastructure-architecture.

regards

didier

On Jul 19, 6:57 am, "J.Ganesan"  wrote:
> I am curious to know the persistence engine used by Google +. Is it
> not Google App Engine ?
>
> J.Ganesan

-- 
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] does Google+ use GAE ?

2011-07-18 Thread J.Ganesan
I am curious to know the persistence engine used by Google +. Is it
not Google App Engine ?

J.Ganesan

-- 
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: bulkloader - namespace -errors

2011-07-18 Thread Aswath Satrasala
Any suggestions on this...

Thanks.

On Sat, Jul 16, 2011 at 10:08 AM, Aswath Satrasala <
aswath.satras...@gmail.com> wrote:

> Hello,
> I was trying to download the data for a particular namespace using the
> bulkloader tool.  Following command is issued.
>
> C:\backup\vs-accounting\asterix>"\Program
> Files\Google\google_appengine"\appcfg.py download_data
> --filename=aswath.sql3 --url=http://vs-accounting.appspot.com/r
> emote_api --namespace=aswath-gmail-com
> Downloading data records.
> [INFO] Logging to bulkloader-log-20110715.201356
> [INFO] Throttling transfers:
> [INFO] Bandwidth: 25 bytes/second
> [INFO] HTTP connections: 8/second
> [INFO] Entities inserted/fetched/modified: 20/second
> [INFO] Batch Size: 10
> [INFO] Opening database: bulkloader-progress-20110715.201356.sql3
> [INFO] Opening database: bulkloader-results-20110715.201356.sql3
> [INFO] Connecting to vs-accounting.appspot.com/remote_api
> [ERROR   ] Unable to download kind stats for all-kinds download.
> [ERROR   ] Kind stats are generated periodically by the appserver
> [ERROR   ] Kind stats are not available on dev_appserver.
>
> Any ideas on how to make bulkloader work with namespaces?
>
> -Aswath
> www.AccountingGuru.in
>

-- 
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: How to ensure two entities are updated WITHOUT using transactions?

2011-07-18 Thread Nichole
By the way, if you wanted vary your jdoconfig.xml settings
knowing which are impl in appengine,  here's a link to
appengine datanucleus test code:

http://code.google.com/p/datanucleus-appengine/source/browse/trunk/tests/META-INF/jdoconfig.xml?r=514&spec=svn514

On Jul 18, 8:44 pm, Nichole  wrote:
> The answer to the nontransactionalread and write are below, but
> meanwhile, if you really do need those updates to be as close
> to atomic as possible, then you need them in the same entity
> group so they're co-located in the distributed file system.
>
> On Jul 18, 2:02 am, mscwd01  wrote:
>
>
>
>
>
>
>
> > Thanks for the update. It's a pity you cant check to see if the first
> > transaction committed before it leaves an "active" state, that'd make
> > things so much easier. I really needed the two updates to occur as
> > quickly as possible so relying on the second update to continue
> > retying via the task queue, is not ideal. Would running the
> > PersistenceManagerFactory with 'NontransactionalRead' and
> > 'NontransactionalWrite' set to 'true' allow me to do what I want? I
> > cant really find any documentation that describes what those two
> > values do.
>
> > Thanks again
>
> > On Jul 17, 11:46 pm,Nichole wrote:
>
> > > Good point, I rewrote the code below to better use the available
> > > connections
> > > and improve the pattern.
>
> > >    Regarding update 1 being committed and update 2 failing, the
> > > first is already committed, yes.  I think one has to use a retry for
> > > the
> > > 2nd update (using the task queue structure) for the 2nd operation to
> > > eventually succeed, but on a longer timescale.
>
> > > Here's a better approach to the problem:
>
> > > import com.climbwithyourfeet.software.twotransaction.util.PMF;
> > > import com.google.appengine.api.datastore.Key;
> > > import java.util.ArrayList;
> > > import javax.jdo.Transaction;
> > > import javax.jdo.PersistenceManager;
> > > import java.util.logging.Logger;
> > > import com.google.appengine.tools.development.LocalDatastoreTestCase;
> > > import java.util.List;
> > > import org.junit.After;
> > > import org.junit.Before;
> > > import org.junit.Test;
>
> > > /**
> > >    Goal:
> > >  *     Update 2 entities which reside in 2 different entity groups.
> > >  *     The updates must both pass or both fail.
> > >  *
> > >  * Solution:
> > >  *     Use a different transaction for each entity, configurable in
> > >         jdoconfig.xml.
> > >  *     (Note that it looks like 2 named PersistenceManagerFactory
> > >         connections are possible, but not more than that, and there
> > >         is only one transaction for a  PMF connection).
> > >  *
> > >  *     Solution is essentially check that transaction1 succeeds or
> > > fails before
> > >  *     committing transaction2.
> > >  *
> > >  *     The case which needs additional fail-over is the case in which
> > >        transaction 1 is committed successfully but transaction2 fails.
> > >  *     In this case a retry of transaction2 should be invoked and must
> > >        eventually succeed.
> > >  *
> > >  *     For that reason, any code using this pattern should design
> > >        the logic so that the logic in the 2nd transaction can be
> > > consistent
> > >        on a longer timescale.
> > >  *
> > >  * @authornichole
> > >  */
> > > public class TwoOperationPseudoTransactionTest extends
> > > LocalDatastoreTestCase {
>
> > >     private final Logger log =
> > > Logger.getLogger(this.getClass().getName());
> > >     private String iden1 = "1234567";
> > >     private String iden2 = "1123456";
>
> > >     public TwoOperationPseudoTransactionTest() {
> > >         super();
> > >     }
>
> > >     @Before
> > >     public void setUp() throws Exception {
> > >         super.setUp();
>
> > >         try {
> > >             PersistenceManager pm = PMF.get().getPersistenceManager();
> > >             Transaction tx = pm.currentTransaction();
> > >             tx.begin();
> > >             UserGameCredits e1 = new UserGameCredits(iden1);
> > >             pm.makePersistent(e1);
> > >             pm.flush();
> > >             tx.commit();
>
> > >             PersistenceManager pm2 =
> > > PMF.get2().getPersistenceManager();
> > >             tx = pm2.currentTransaction();
> > >             tx.begin();
> > >             UserAccount e2 = new UserAccount(iden2);
> > >             pm2.makePersistent(e2);
> > >             pm2.flush();
> > >             tx.commit();
> > >         } catch (Throwable t) {
> > >             String msg = t.getMessage();
> > >         }
> > >     }
>
> > >     @After
> > >     public void tearDown() throws Exception {
> > >         super.tearDown();
> > >     }
>
> > >     @Test
> > >     public void test2() throws Exception {
>
> > >         PersistenceManager pm = PMF.get().getPersistenceManager();
> > >         PersistenceManager pm2 = PMF.get2().getPersistenceManager();
>
> > >         final Transaction tx = pm.currentTransaction();
> > >         final Transa

[appengine-java] Re: How to ensure two entities are updated WITHOUT using transactions?

2011-07-18 Thread Nichole
The answer to the nontransactionalread and write are below, but
meanwhile, if you really do need those updates to be as close
to atomic as possible, then you need them in the same entity
group so they're co-located in the distributed file system.

On Jul 18, 2:02 am, mscwd01  wrote:
> Thanks for the update. It's a pity you cant check to see if the first
> transaction committed before it leaves an "active" state, that'd make
> things so much easier. I really needed the two updates to occur as
> quickly as possible so relying on the second update to continue
> retying via the task queue, is not ideal. Would running the
> PersistenceManagerFactory with 'NontransactionalRead' and
> 'NontransactionalWrite' set to 'true' allow me to do what I want? I
> cant really find any documentation that describes what those two
> values do.
>
> Thanks again
>
> On Jul 17, 11:46 pm,Nichole wrote:
>
>
>
>
>
>
>
> > Good point, I rewrote the code below to better use the available
> > connections
> > and improve the pattern.
>
> >    Regarding update 1 being committed and update 2 failing, the
> > first is already committed, yes.  I think one has to use a retry for
> > the
> > 2nd update (using the task queue structure) for the 2nd operation to
> > eventually succeed, but on a longer timescale.
>
> > Here's a better approach to the problem:
>
> > import com.climbwithyourfeet.software.twotransaction.util.PMF;
> > import com.google.appengine.api.datastore.Key;
> > import java.util.ArrayList;
> > import javax.jdo.Transaction;
> > import javax.jdo.PersistenceManager;
> > import java.util.logging.Logger;
> > import com.google.appengine.tools.development.LocalDatastoreTestCase;
> > import java.util.List;
> > import org.junit.After;
> > import org.junit.Before;
> > import org.junit.Test;
>
> > /**
> >    Goal:
> >  *     Update 2 entities which reside in 2 different entity groups.
> >  *     The updates must both pass or both fail.
> >  *
> >  * Solution:
> >  *     Use a different transaction for each entity, configurable in
> >         jdoconfig.xml.
> >  *     (Note that it looks like 2 named PersistenceManagerFactory
> >         connections are possible, but not more than that, and there
> >         is only one transaction for a  PMF connection).
> >  *
> >  *     Solution is essentially check that transaction1 succeeds or
> > fails before
> >  *     committing transaction2.
> >  *
> >  *     The case which needs additional fail-over is the case in which
> >        transaction 1 is committed successfully but transaction2 fails.
> >  *     In this case a retry of transaction2 should be invoked and must
> >        eventually succeed.
> >  *
> >  *     For that reason, any code using this pattern should design
> >        the logic so that the logic in the 2nd transaction can be
> > consistent
> >        on a longer timescale.
> >  *
> >  * @authornichole
> >  */
> > public class TwoOperationPseudoTransactionTest extends
> > LocalDatastoreTestCase {
>
> >     private final Logger log =
> > Logger.getLogger(this.getClass().getName());
> >     private String iden1 = "1234567";
> >     private String iden2 = "1123456";
>
> >     public TwoOperationPseudoTransactionTest() {
> >         super();
> >     }
>
> >     @Before
> >     public void setUp() throws Exception {
> >         super.setUp();
>
> >         try {
> >             PersistenceManager pm = PMF.get().getPersistenceManager();
> >             Transaction tx = pm.currentTransaction();
> >             tx.begin();
> >             UserGameCredits e1 = new UserGameCredits(iden1);
> >             pm.makePersistent(e1);
> >             pm.flush();
> >             tx.commit();
>
> >             PersistenceManager pm2 =
> > PMF.get2().getPersistenceManager();
> >             tx = pm2.currentTransaction();
> >             tx.begin();
> >             UserAccount e2 = new UserAccount(iden2);
> >             pm2.makePersistent(e2);
> >             pm2.flush();
> >             tx.commit();
> >         } catch (Throwable t) {
> >             String msg = t.getMessage();
> >         }
> >     }
>
> >     @After
> >     public void tearDown() throws Exception {
> >         super.tearDown();
> >     }
>
> >     @Test
> >     public void test2() throws Exception {
>
> >         PersistenceManager pm = PMF.get().getPersistenceManager();
> >         PersistenceManager pm2 = PMF.get2().getPersistenceManager();
>
> >         final Transaction tx = pm.currentTransaction();
> >         final Transaction tx2 = pm2.currentTransaction();
>
> >         final List completedOp1 = new ArrayList();
> >         final List completedOp2 = new ArrayList();
>
> >         try {
>
> >             // change to for tests
> >             final boolean commit1 = true;
> >             final boolean commit2 = false;
>
> >             tx.setSynchronization(new
> > javax.transaction.Synchronization() {
> >                 public void beforeCompletion() {
> >                     log.info("before transaction 1");
> >          

[appengine-java] Re: How to ensure two entities are updated WITHOUT using transactions?

2011-07-18 Thread Nichole
The 2 properties that you are trying to set nontransactionalRead and
nontransactionalRead are what is set in the jdoconfig.xml.

They define whether that persistence manager will allow queries
that are not in a transaction.  The datanucleus documentation isn't
as readily available for jdo 2.3, so here's what the kodo docs say:

2.5.10. javax.jdo.option.NontransactionalRead
Property name: javax.jdo.option.NontransactionalRead
Configuration API: kodo.conf.JDOConfiguration.getNontransactionalRead
Resource adaptor config-property: NontransactionalRead
Default: true
Description: Whether the JDO runtime will allow you to read data
outside of a transaction.
See Section 7.2, “PersistenceManagerFactory Properties” in the JDO
Overview for details.

2.5.11. javax.jdo.option.NontransactionalWrite
Property name: javax.jdo.option.NontransactionalWrite
Configuration API: kodo.conf.JDOConfiguration.getNontransactionalWrite
Resource adaptor config-property: NontransactionalWrite
Default: false
Description: Whether you can modify persistent fields outside of a
transaction.
See Section 7.2, “PersistenceManagerFactory Properties” in the JDO
Overview for details.

http://download.oracle.com/docs/cd/E13189_01/kodo/docs316/ref_guide_conf_jdo.html#javax.jdo.option.NontransactionalRead

One last post of the example that includes asserts and a few
more comments to make it readable:

package com.climbwithyourfeet.software.twotransaction.model;

import com.climbwithyourfeet.software.twotransaction.util.PMF;
import com.google.appengine.api.datastore.Key;
import java.util.ArrayList;
import javax.jdo.Transaction;
import javax.jdo.PersistenceManager;
import java.util.logging.Logger;
import com.google.appengine.tools.development.LocalDatastoreTestCase;
import java.util.List;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;

/**
   Goal:
 * Update 2 entities which reside in 2 different entity groups.
 * The updates must both pass or both fail.
 *
 * Solution:
 * Use a different transaction for each entity,
 *  configurable in jdoconfig.xml.
 * (Note that it looks like 2 named PersistenceMaangerFactory
 *  connections are
 *  possible, but not more than that, and there is only one
 *  transaction for a PMF connection).
 *
 * Solution is essentially check that transaction1 succeeds
 * or fails before committing transaction2.
 *
 * The case which needs additional fail-over is the case in
 * which transaction 1 is committed successfully but transaction2
 * fails. In this case a retry of transaction2 should be invoked
 * and must eventually succeed.
 *
 * For that reason, any code using this pattern should design the
 * logic so that the logic in the 2nd transaction can be
consistent
 * on a longer timescale.
 *
 * @author nichole
 */
public class TwoOperationPseudoTransactionTest extends
LocalDatastoreTestCase {

private final Logger log = Logger.getLogger(
this.getClass().getName());

private String iden1 = "1234567";
private String iden2 = "1123456";

// change to for tests
final boolean commit1 = true;
final boolean commit2 = false;

public TwoOperationPseudoTransactionTest() {
super();
}

@Before
public void setUp() throws Exception {
super.setUp();

log.info("setUp");

try {

PersistenceManager pm =
PMF.get().getPersistenceManager();
Transaction tx = pm.currentTransaction();
tx.begin();
UserGameCredits e1 = new UserGameCredits(iden1);
pm.makePersistent(e1);
pm.flush();
tx.commit();

PersistenceManager pm2 =
PMF.get2().getPersistenceManager();
tx = pm2.currentTransaction();
tx.begin();
UserAccount e2 = new UserAccount(iden2);
pm2.makePersistent(e2);
pm2.flush();
tx.commit();
} catch (Throwable t) {
String msg = t.getMessage();
}
}

@After
public void tearDown() throws Exception {

PersistenceManager pm = null;

try {
pm = PMF.get().getPersistenceManager();

Key key1 = UserGameCredits.createKey(iden1);
UserGameCredits e1 =
pm.getObjectById(UserGameCredits.class, key1);
String var1 = e1.getVariable();

Key key2 = UserAccount.createKey(iden2);
UserAccount e2 =
pm.getObjectById(UserAccount.class, key2);
String var2 = e2.getVariable();

log.info("var1=" + var1);
log.info("var2=" + var2);

if (commit1 && commit2) {
assertEquals(var1, "updated");
assertEquals(var2, "updated");

} else if (commit1 && !commit2) {
assertEquals(var1, "updated");
assertEquals(var2, "");
} else {
  

[appengine-java] Re: Google accounts login as part of moduleLoad - CPU intensive - please comment

2011-07-18 Thread dreamer
I did not give the context, I am using GWT+GAE - for my app.
In GWT module load I am calling RPC service to check if user
is already login to google accounts.

Some thing is conflicting between RPC return rendering GWT module
load.
May be browser did not complete rendering while rpc return is trying
paint some widgets.

Is there any safe way ?

On Jul 18, 7:36 am, dreamer  wrote:
> Hi,
>
> I am using UserService login using google accounts. Logs are showing
> it is taking lot of cpu taime.
> Could you Please share your experience.
>
> 2011-07-18 07:17:12.872 /schooldistrict/login 200 1722ms 1594cpu_ms
> 0kb Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/534.30 (KHTML,
> like Gecko) Chrome/12.0.742.122 Safari/534.30,gzip(gfe)
> 72.219.189.151 - - [18/Jul/2011:07:17:12 -0700] "POST /schooldistrict/
> login HTTP/1.1" 200 415 "http://schoolk12.appspot.com/"; "Mozilla/5.0
> (Windows NT 6.1; WOW64) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/
> 12.0.742.122 Safari/534.30,gzip(gfe)" "schoolk12.appspot.com" ms=1723
> cpu_ms=1594 api_cpu_ms=0 cpm_usd=0.044401 loading_request=1
> I 2011-07-18 07:17:12.747
> com.google.appengine.repackaged.com.google.common.base.internal.Finalizer
> getInheritableThreadLocalsField: Couldn't access
> Thread.inheritableThreadLocals. Reference finalizer threads will
> inherit thread local values.
> I 2011-07-18 07:17:12.871
> This request caused a new process to be started for your application,
> and thus caused your application code to be loaded for the first time.
> This request may thus take longer and use more CPU than a typical
> request for your application.

-- 
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] Scheduler features and load time limitations

2011-07-18 Thread Marcel Overdijk
Everybody knows about load time issues when using frameworks that take
a long time to startup. Take for example Grails.

I wonder if we will still encounter these issues after the pricing
changes.

1) Will the limit of 30s to start an application be lifted?

2) How smart will the scheduler be to startup new instances? Will it
for example take into account the avg load time of previously started
instances?


-- 
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: Experimental blobstore api returning null keys on blob creation

2011-07-18 Thread tempy
I'd just like to update that after the recent instability and errors,
this problem has gotten MUCH WORSE. I really hope that something can
be done, soon.

On Jul 17, 12:21 pm, tempy  wrote:
> That's exactly my issue, starred, thanks Tom.
>
> This has been a high priority issue for 3 months now, and still open!
>
> On Jul 17, 4:41 am, Tom Fishman  wrote:
>
>
>
>
>
>
>
> > Assuming you're talking about new blobs, please check this
> > issue:http://code.google.com/p/googleappengine/issues/detail?id=4872.
>
> > I think there is no "good" workaround yet.

-- 
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: How to ensure two entities are updated WITHOUT using transactions?

2011-07-18 Thread mscwd01
Last question, promise!

I decided to do what the above exception so kindly suggested and
created a new PersistenceManager as follows:

  PersistenceManagerFactory pmfInstance =
JDOHelper.getPersistenceManagerFactory("transactions-optional");
  pmfInstance.setNontransactionalRead(true);
  pmfInstance.setNontransactionalWrite(true);

Basically, I set both NontransactionalRead and NontransactionalWrite
to true. This seemed to solve my issue and rolled back the first
transaction if the second update failed. Great! However, I'm not sure
what these two settings do and I'm slightly worried I may be getting
myself into more problems by messing with them. Could someone kindly
tell me if my "fix" is suitable and/or safe?

Thanks

On Jul 18, 10:02 am, mscwd01  wrote:
> Thanks for theupdate. It's a pity you cant check to see if the first
> transaction committed before it leaves an "active" state, that'd make
> things so much easier. I really needed thetwoupdates to occur as
> quickly as possible so relying on the secondupdateto continue
> retying via the task queue, is not ideal. Would running the
> PersistenceManagerFactory with 'NontransactionalRead' and
> 'NontransactionalWrite' set to 'true' allow me to do what I want? I
> cant really find any documentation that describes what thosetwo
> values do.
>
> Thanks again
>
> On Jul 17, 11:46 pm, Nichole  wrote:
>
>
>
>
>
>
>
> > Good point, I rewrote the code below to better use the available
> > connections
> > and improve the pattern.
>
> >    Regardingupdate1 being committed andupdate2 failing, the
> > first is already committed, yes.  I think one has to use a retry for
> > the
> > 2ndupdate(using the task queue structure) for the 2nd operation to
> > eventually succeed, but on a longer timescale.
>
> > Here's a better approach to the problem:
>
> > import com.climbwithyourfeet.software.twotransaction.util.PMF;
> > import com.google.appengine.api.datastore.Key;
> > import java.util.ArrayList;
> > import javax.jdo.Transaction;
> > import javax.jdo.PersistenceManager;
> > import java.util.logging.Logger;
> > import com.google.appengine.tools.development.LocalDatastoreTestCase;
> > import java.util.List;
> > import org.junit.After;
> > import org.junit.Before;
> > import org.junit.Test;
>
> > /**
> >    Goal:
> >  *    Update2entitieswhich reside in 2 different entity groups.
> >  *     The updates must both pass or both fail.
> >  *
> >  * Solution:
> >  *     Use a different transaction for each entity, configurable in
> >         jdoconfig.xml.
> >  *     (Note that it looks like 2 named PersistenceManagerFactory
> >         connections are possible, but not more than that, and there
> >         is only one transaction for a  PMF connection).
> >  *
> >  *     Solution is essentially check that transaction1 succeeds or
> > fails before
> >  *     committing transaction2.
> >  *
> >  *     The case which needs additional fail-over is the case in which
> >        transaction 1 is committed successfully but transaction2 fails.
> >  *     In this case a retry of transaction2 should be invoked and must
> >        eventually succeed.
> >  *
> >  *     For that reason, any code using this pattern should design
> >        the logic so that the logic in the 2nd transaction can be
> > consistent
> >        on a longer timescale.
> >  *
> >  * @author nichole
> >  */
> > public class TwoOperationPseudoTransactionTest extends
> > LocalDatastoreTestCase {
>
> >     private final Logger log =
> > Logger.getLogger(this.getClass().getName());
> >     private String iden1 = "1234567";
> >     private String iden2 = "1123456";
>
> >     public TwoOperationPseudoTransactionTest() {
> >         super();
> >     }
>
> >     @Before
> >     public void setUp() throws Exception {
> >         super.setUp();
>
> >         try {
> >             PersistenceManager pm = PMF.get().getPersistenceManager();
> >             Transaction tx = pm.currentTransaction();
> >             tx.begin();
> >             UserGameCredits e1 = new UserGameCredits(iden1);
> >             pm.makePersistent(e1);
> >             pm.flush();
> >             tx.commit();
>
> >             PersistenceManager pm2 =
> > PMF.get2().getPersistenceManager();
> >             tx = pm2.currentTransaction();
> >             tx.begin();
> >             UserAccount e2 = new UserAccount(iden2);
> >             pm2.makePersistent(e2);
> >             pm2.flush();
> >             tx.commit();
> >         } catch (Throwable t) {
> >             String msg = t.getMessage();
> >         }
> >     }
>
> >     @After
> >     public void tearDown() throws Exception {
> >         super.tearDown();
> >     }
>
> >     @Test
> >     public void test2() throws Exception {
>
> >         PersistenceManager pm = PMF.get().getPersistenceManager();
> >         PersistenceManager pm2 = PMF.get2().getPersistenceManager();
>
> >         final Transaction tx = pm.currentTransaction();
> >         final Transaction tx2 = pm2.currentTransaction();
>
> >

Re: [appengine-java] Re: [google-appengine] Re: CMS for GAE

2011-07-18 Thread Prashant
Yes, you are right. Picking an opensource project and making it work for you
is very easy, but making something from scratch has its own fun :) . I
stared building Claymus because I felt need of Java based CMS which is made
for GAE, considering what GAE is, how it is different from other hosting
services, services/apis GAE is providing to developers, etc. etc. etc.

Claymus is designed to give you maximum flexibility and support to build
your app on top of Claymus. Along with all the GAE features you can take
advantage of Servlet Level caching to minimize delay and cpu usage, plugable
modules and themes, etc ... (complete list will be put on updated Claymus
Website :) ).


Regards,
Prashant


On Mon, Jul 18, 2011 at 7:28 PM, Niklas Rosencrantz wrote:

> Having something like a CMS eg like wordpress, joomla or mediawiki
> compatible then we won't have to start every project from scratch and
> project would become more configuration than programming which naturally is
> an advantage since programming takes more time than just configuring a new
> CMS deployment. I used web2py for a project when a friend wanted a quick
> website started and naturally to change pages we'd prefer a web-based editor
> instead of changing templates and redeploying. I'm glad to see some CMS are
> coming to app engine. Some frameworks offer features that are getting close
> to that of a CMS, for instance GAE Framework (www.gaeframework.com) comes
> with a blog engine and when you have a blog you are getting close the the
> functions of a CMS. Do you agree?
>
>
> On Sun, Jul 17, 2011 at 3:48 AM, Maneesh Arora  wrote:
>
>> What's the unique advantage of having a CMS in GAE?
>>
>> thanks,
>>
>> Maneesh
>> http://mightytext.net
>>
>> On Sat, Jul 16, 2011 at 11:25 AM, Prashant  wrote:
>>
>>> Hi All,
>>>
>>> Claymus is close to its (first) preview release. Only few bug fixes and
>>> minor modifications are remaining. Check out the live demo at
>>> http://demo.claymus.com .
>>>
>>> --
>>> Prashant
>>> claymus.googlecode.com
>>>
>>>
>>> On Wed, May 25, 2011 at 10:29 AM, Jeff Schnitzer wrote:
>>>
 On Mon, May 23, 2011 at 11:17 AM, Brandon Wirtz 
 wrote:
 > That's more deployed, not "spoken".  Every Blogger and IT guy on the
 planet
 > can hack together a PHP Plugin for their CMS.  Very Few can do that in
 > Python or Java.

 ...and even fewer can do it in Ruby or C#.

 Truly, PHP is in a class by itself.

 Jeff

 --
 You received this message because you are subscribed to the Google
 Groups "Google App Engine" group.
 To post to this group, send email to google-appeng...@googlegroups.com.
 To unsubscribe from this group, send email to
 google-appengine+unsubscr...@googlegroups.com.
 For more options, visit this group at
 http://groups.google.com/group/google-appengine?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-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.
>>>
>>
>>  --
>> You received this message because you are subscribed to the Google Groups
>> "Google App Engine" group.
>> To post to this group, send email to google-appeng...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> google-appengine+unsubscr...@googlegroups.com.
>> For more options, visit this group at
>> http://groups.google.com/group/google-appengine?hl=en.
>>
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine" group.
> To post to this group, send email to google-appeng...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/google-appengine?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-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: Can I/Should I test my *ServiceImpl class? (RPC calls - GAE+GWT+MVP)

2011-07-18 Thread Drew Spencer
Ugh... I've been a total muppet for the last week and a half. Even more so 
than normal.

I'm sure I tried to create a new PortalServiceImpl in my regular TestCase 
last week and got some kind of error... clearly not.

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-appengine-java/-/vnDhQUYYmTsJ.
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] Google accounts login as part of moduleLoad - CPU intensive - please comment

2011-07-18 Thread dreamer
Hi,

I am using UserService login using google accounts. Logs are showing
it is taking lot of cpu taime.
Could you Please share your experience.


2011-07-18 07:17:12.872 /schooldistrict/login 200 1722ms 1594cpu_ms
0kb Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/534.30 (KHTML,
like Gecko) Chrome/12.0.742.122 Safari/534.30,gzip(gfe)
72.219.189.151 - - [18/Jul/2011:07:17:12 -0700] "POST /schooldistrict/
login HTTP/1.1" 200 415 "http://schoolk12.appspot.com/"; "Mozilla/5.0
(Windows NT 6.1; WOW64) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/
12.0.742.122 Safari/534.30,gzip(gfe)" "schoolk12.appspot.com" ms=1723
cpu_ms=1594 api_cpu_ms=0 cpm_usd=0.044401 loading_request=1
I 2011-07-18 07:17:12.747
com.google.appengine.repackaged.com.google.common.base.internal.Finalizer
getInheritableThreadLocalsField: Couldn't access
Thread.inheritableThreadLocals. Reference finalizer threads will
inherit thread local values.
I 2011-07-18 07:17:12.871
This request caused a new process to be started for your application,
and thus caused your application code to be loaded for the first time.
This request may thus take longer and use more CPU than a typical
request for your application.

-- 
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] Javadoc missing in Google plugin for Eclipse

2011-07-18 Thread Patrick
Hello,
I'm using Google plugin for Eclipse 3.6, and Javadoc is missing for many 
classes: servlet, Cache, Json, etc.
Did I miss something? Is it a config problem?
Thanks,
Patrick

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-appengine-java/-/ME2NRAY8tNQJ.
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] Datastore doing nothing in dev environment

2011-07-18 Thread Paul Schmidt
  down 
votefavorite
 
**
  
Indigo on Windows 7 Pro 64bit

Just bringing up an app for the first time; my datastore code is a close 
copy of various examples out there, and is just trying to save a single 
simple object.

The pm.MakePersistent(o) apparently succeeds (i.e. doesn't throw an 
exception), but the datastore viewer shows no objects, and the local_db.bin 
file does not appear (although datastore-indexes-auto.xml was generated in 
that directory).

A subsequent query for the object (using a known field value) returns 
nothing (unsurprising given the viewer shows nothing.)

I suspect a workspace configuration problem, but would have thought some 
sort of error would have appeared...

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-appengine-java/-/-aGDf-P-k6EJ.
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] Netbeans support

2011-07-18 Thread Pascal Emile Fares
Hello,

why there is no Netbeans support?

Who is like me wich to have support for Netbeans like in Eclipse

Regards

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-appengine-java/-/YVqaEs8CLtAJ.
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] Installation problem in Google plugin

2011-07-18 Thread sunil
Hi guys ,

 I have problem in installing the Google app engine plugin(Java) for
Eclipse Indigo,I am Installing for Indigo Java EE IDE, I downloaded
the Google Archive and try to Install but IDE says two are more files
missing during installation.
I want to know whether they are any supporting file to be installed to
eclipse.
.

-- 
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] An ImageIO plugin must be installed

2011-07-18 Thread Stéphane
Hi All,
And sorry to reopen this topic but I have the same warning message
using SDK 1.5.1 and I'm not trying to resize any image, I'm just
serving images in the jpg/png format from the blobstore...
The only call to the imageservice in my app is in a converter :

viewBean.setImageUrl(ImagesServiceFactory.getImagesService().getServingUrl(object.getBlobkey()));

Did anybody had the same issue? (it's a warning not an error...)
Thanks'
Steph

-- 
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: Unable to find the webapp directory Files\GoogleAppEngine\appengine- java-sdk-1.3.0\demos\guestbook\war

2011-07-18 Thread werdender
Run CD C:\ & appengine-java-sdk-1.3.0\demos\guestbook\war

On 30 май, 17:35, Suresh  wrote:
> hi
>
> i have just installed the java sdk. after extracting the files from
> the appengine-java-sdk-1.3.0 jar, I am trying to start the server
> with
> at the command line with the following:
>
> C:\Program Files\GoogleAppEngine\appengine-java-
> sdk-1.3.0\bin>dev_appserver.cmd C:\Program Files\GoogleAppEngine
> \appengine-java-sdk-1.3.0\demos\guestbook\war
>
> I get the following error message:
>
> Unable to find the webapp directory Files\GoogleAppEngine\appengine-
> java-sdk-1.3.0\demos\guestbook\war
>
> can anyone help?
>
> Thx

-- 
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] Entity Relationships

2011-07-18 Thread Matt
I'm pretty new to the JDO/GAE world, and I'm having some troubles
grasping the entity relationship models. I have read about entity
groups and parent keys but I can't seem to implement it correctly in
my example.

I started by trying to model my entities the same way I have done it a
million times with JPA and relational databases (see below), but it is
not working right. The first error I receive is trying to query for a
Team by a manager (select from team where manager==managerParam), I
get an error "Key of parameter value does not have a parent". So
obviously my relationships are not right. I haven't even gotten to the
Collection yet, since I can't get a simple relationship
working

Any help would be appreciated!


@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class Manager {

@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Key id;

@Persistent
private User user;
}


@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class Team {

@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Key id;

@Persistent
private String name;

@Persistent
private Manager manager;

@Persistent
private Collection players;
}

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class Player {

@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Key id;

@Persistent
private String name;
}


-- 
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] Task queue timeout with no exception logged

2011-07-18 Thread JP
Hi,

I have a task chain that occasionally freezes and eventually times out after 
10 mins.  Tasks normally complete in less than a second but every minute or 
so one task will lock up.  No exception is logged but this is shown in the 
logs:

A serious problem was encountered with the process that handled this request, 
causing it to exit. This is likely to cause a new process to be used for the 
next request to your application. If you see this message frequently, you may 
have a memory leak in your application. (Error code 201)


The same task will re-run without error so I suspect some kind of locking 
problem.  However, I cannot be sure and without an exception I do not know 
where to start looking.  The instances tab shows that no instance is using 
more than 82MB.

I'm on the HT datastore and have multi threading turned 

Thanks!

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-appengine-java/-/NDThPulmyhsJ.
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: Axis2 soap client implementation doesn't work

2011-07-18 Thread kamco
Thank for the answers, but i couldn't solve this problem, so I am not
using Axis2 anymore.

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



Re: [appengine-java] Re: [google-appengine] Re: CMS for GAE

2011-07-18 Thread Prashant
Hi,

Claymus is not yet ready for preview but still you can get project snapshot
from https://code.google.com/p/claymus/downloads/list .

You should be able to import downloaded code as eclipse project. You may
need to do minor changes in project settings, sdk paths, etc. on eclipse,
before you can run or deploy it.

--
Prashant

On Mon, Jul 18, 2011 at 4:56 PM, Cyrille Vincey  wrote:

> Hi,
>
> Is Claymus already available for download and testing?
> Thanks in advance,
> Cyrille
>
> On Jul 17, 5:48 am, Maneesh Arora  wrote:
> > What's the unique advantage of having a CMS in GAE?
> >
> > thanks,
> >
> > Maneeshhttp://mightytext.net
> >
> >
> >
> >
> >
> >
> >
> > On Sat, Jul 16, 2011 at 11:25 AM, Prashant  wrote:
> > > Hi All,
> >
> > > Claymus is close to its (first) preview release. Only few bug fixes and
> > > minor modifications are remaining. Check out the live demo at
> > >http://demo.claymus.com.
> >
> > > --
> > > Prashant
> > > claymus.googlecode.com
> >
> > > On Wed, May 25, 2011 at 10:29 AM, Jeff Schnitzer  >wrote:
> >
> > >> On Mon, May 23, 2011 at 11:17 AM, Brandon Wirtz 
> > >> wrote:
> > >> > That's more deployed, not "spoken".  Every Blogger and IT guy on the
> > >> planet
> > >> > can hack together a PHP Plugin for their CMS.  Very Few can do that
> in
> > >> > Python or Java.
> >
> > >> ...and even fewer can do it in Ruby or C#.
> >
> > >> Truly, PHP is in a class by itself.
> >
> > >> Jeff
> >
> > >> --
> > >> You received this message because you are subscribed to the Google
> Groups
> > >> "Google App Engine" group.
> > >> To post to this group, send email to
> google-appeng...@googlegroups.com.
> > >> To unsubscribe from this group, send email to
> > >> google-appengine+unsubscr...@googlegroups.com.
> > >> For more options, visit this group at
> > >>http://groups.google.com/group/google-appengine?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-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.
>
> --
> 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.
>
>

-- 
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: [google-appengine] Re: CMS for GAE

2011-07-18 Thread Cyrille Vincey
Hi,

Is Claymus already available for download and testing?
Thanks in advance,
Cyrille

On Jul 17, 5:48 am, Maneesh Arora  wrote:
> What's the unique advantage of having a CMS in GAE?
>
> thanks,
>
> Maneeshhttp://mightytext.net
>
>
>
>
>
>
>
> On Sat, Jul 16, 2011 at 11:25 AM, Prashant  wrote:
> > Hi All,
>
> > Claymus is close to its (first) preview release. Only few bug fixes and
> > minor modifications are remaining. Check out the live demo at
> >http://demo.claymus.com.
>
> > --
> > Prashant
> > claymus.googlecode.com
>
> > On Wed, May 25, 2011 at 10:29 AM, Jeff Schnitzer wrote:
>
> >> On Mon, May 23, 2011 at 11:17 AM, Brandon Wirtz 
> >> wrote:
> >> > That's more deployed, not "spoken".  Every Blogger and IT guy on the
> >> planet
> >> > can hack together a PHP Plugin for their CMS.  Very Few can do that in
> >> > Python or Java.
>
> >> ...and even fewer can do it in Ruby or C#.
>
> >> Truly, PHP is in a class by itself.
>
> >> Jeff
>
> >> --
> >> You received this message because you are subscribed to the Google Groups
> >> "Google App Engine" group.
> >> To post to this group, send email to google-appeng...@googlegroups.com.
> >> To unsubscribe from this group, send email to
> >> google-appengine+unsubscr...@googlegroups.com.
> >> For more options, visit this group at
> >>http://groups.google.com/group/google-appengine?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-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.

-- 
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] Can I/Should I test my *ServiceImpl class? (RPC calls - GAE+GWT+MVP)

2011-07-18 Thread Drew Spencer
Hi coders,

I posted this in the GWT group but got no response. It kinda belongs in both 
because it regards RPC calls and the datastore, but since I got no answers 
there I thought I would post it here too:

I'm still learning GAE+GWT and trying to get into unit testing as I go 
along. I have finally managed to get my head around MVP and have written 
some basic tests to test my presenters, using mock objects for the view and 
server-side service. All good.

My question is this: *How can I test whether my RPC calls are working? 
Should I even be trying to test them?*

For example, in my ServiceImpl class I have a function fillDatastore() that 
populates it with some dummy data - I would like to be able to run this on 
the datastore stub, using LocalServiceTestHelper, a bit like this test, but 
using my server side code instead of putting the actual insert code into the 
test itself:
http://code.google.com/appengine/docs/java/tools/localunittesting.html#Writing_Datastore_and_Memcache_Tests

As far as I understand it - I can't use GWT.create() to make a real rpc 
service in a TestCase (have to mock it), and I can't create a datastore stub 
inside a GwtTestCase. If anyone can point me in the right direction, tell me 
where I'm confused I would appreciate it greatly.

Cheers,

Drew

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-appengine-java/-/qz2E6uRE1D0J.
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: Difference between xmpp and channel api

2011-07-18 Thread Didier Durand
Hi,

the 1st very big difference is that XMPP is a standard independent of
Google where Channel API is not.

If you develop on XMPP, you can reach people using a vast palette of
client software.

regards

didier

On Jul 18, 12:38 pm, dreamer  wrote:
> Hi,
>
> I am going through the XMPP and Channel API examples in
>
> http://googcloudlabs.appspot.com/
>
> Both seems to be for chat kind of applications, not sure what fits
> where, any good use cases please ?
>
> -Venuhttp://schoolk12.appspot.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-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] Difference between xmpp and channel api

2011-07-18 Thread dreamer
Hi,

I am going through the XMPP and Channel API examples in

http://googcloudlabs.appspot.com/

Both seems to be for chat kind of applications, not sure what fits
where, any good use cases please ?

-Venu
http://schoolk12.appspot.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-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: How to ensure two entities are updated WITHOUT using transactions?

2011-07-18 Thread mscwd01
Thanks for the update. It's a pity you cant check to see if the first
transaction committed before it leaves an "active" state, that'd make
things so much easier. I really needed the two updates to occur as
quickly as possible so relying on the second update to continue
retying via the task queue, is not ideal. Would running the
PersistenceManagerFactory with 'NontransactionalRead' and
'NontransactionalWrite' set to 'true' allow me to do what I want? I
cant really find any documentation that describes what those two
values do.

Thanks again



On Jul 17, 11:46 pm, Nichole  wrote:
> Good point, I rewrote the code below to better use the available
> connections
> and improve the pattern.
>
>    Regarding update 1 being committed and update 2 failing, the
> first is already committed, yes.  I think one has to use a retry for
> the
> 2nd update (using the task queue structure) for the 2nd operation to
> eventually succeed, but on a longer timescale.
>
> Here's a better approach to the problem:
>
> import com.climbwithyourfeet.software.twotransaction.util.PMF;
> import com.google.appengine.api.datastore.Key;
> import java.util.ArrayList;
> import javax.jdo.Transaction;
> import javax.jdo.PersistenceManager;
> import java.util.logging.Logger;
> import com.google.appengine.tools.development.LocalDatastoreTestCase;
> import java.util.List;
> import org.junit.After;
> import org.junit.Before;
> import org.junit.Test;
>
> /**
>    Goal:
>  *     Update 2 entities which reside in 2 different entity groups.
>  *     The updates must both pass or both fail.
>  *
>  * Solution:
>  *     Use a different transaction for each entity, configurable in
>         jdoconfig.xml.
>  *     (Note that it looks like 2 named PersistenceManagerFactory
>         connections are possible, but not more than that, and there
>         is only one transaction for a  PMF connection).
>  *
>  *     Solution is essentially check that transaction1 succeeds or
> fails before
>  *     committing transaction2.
>  *
>  *     The case which needs additional fail-over is the case in which
>        transaction 1 is committed successfully but transaction2 fails.
>  *     In this case a retry of transaction2 should be invoked and must
>        eventually succeed.
>  *
>  *     For that reason, any code using this pattern should design
>        the logic so that the logic in the 2nd transaction can be
> consistent
>        on a longer timescale.
>  *
>  * @author nichole
>  */
> public class TwoOperationPseudoTransactionTest extends
> LocalDatastoreTestCase {
>
>     private final Logger log =
> Logger.getLogger(this.getClass().getName());
>     private String iden1 = "1234567";
>     private String iden2 = "1123456";
>
>     public TwoOperationPseudoTransactionTest() {
>         super();
>     }
>
>     @Before
>     public void setUp() throws Exception {
>         super.setUp();
>
>         try {
>             PersistenceManager pm = PMF.get().getPersistenceManager();
>             Transaction tx = pm.currentTransaction();
>             tx.begin();
>             UserGameCredits e1 = new UserGameCredits(iden1);
>             pm.makePersistent(e1);
>             pm.flush();
>             tx.commit();
>
>             PersistenceManager pm2 =
> PMF.get2().getPersistenceManager();
>             tx = pm2.currentTransaction();
>             tx.begin();
>             UserAccount e2 = new UserAccount(iden2);
>             pm2.makePersistent(e2);
>             pm2.flush();
>             tx.commit();
>         } catch (Throwable t) {
>             String msg = t.getMessage();
>         }
>     }
>
>     @After
>     public void tearDown() throws Exception {
>         super.tearDown();
>     }
>
>     @Test
>     public void test2() throws Exception {
>
>         PersistenceManager pm = PMF.get().getPersistenceManager();
>         PersistenceManager pm2 = PMF.get2().getPersistenceManager();
>
>         final Transaction tx = pm.currentTransaction();
>         final Transaction tx2 = pm2.currentTransaction();
>
>         final List completedOp1 = new ArrayList();
>         final List completedOp2 = new ArrayList();
>
>         try {
>
>             // change to for tests
>             final boolean commit1 = true;
>             final boolean commit2 = false;
>
>             tx.setSynchronization(new
> javax.transaction.Synchronization() {
>                 public void beforeCompletion() {
>                     log.info("before transaction 1");
>                 }
>                 public void afterCompletion(int status) {
>                     switch (status) {
>                         case
> javax.transaction.Status.STATUS_MARKED_ROLLBACK :
>                             // fall through
>                         case
> javax.transaction.Status.STATUS_ROLLEDBACK :
>                             log.severe("rollback transaction 1");
>                             break;
>                         case
> javax.transaction.Status.STATUS_COMMITTED:
>