[appengine-java] Re: DEPLOYMENT FAILING AGAIN

2010-12-15 Thread Simon
Hi,

I don't know why the pre-compilation has to be turned off - as far as
I understand it, this activity occurs on the Google servers and it's
there that the problem occurs.  In one of the other deployment issue
threads, Ikai mentioned that you can get around this issue by turning
the pre-compilation off, so I'm just repeating that information!

On Dec 14, 10:25 pm, J Handal jhand...@gmail.com wrote:
 Simon

 I have exactly the same problem.I upgraded de JRE and JDK to version 6 build
 23(Last one)

 Why the jsp file don't compile?

 If you get the solution please let me know.

-- 
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] Multiple Async get vs one Sync batch get?

2010-12-15 Thread Gal Dolber
Should I expect the similar performance? or the batch will always be better?

-- 
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: Synchronized reads/writes on a memcache variable

2010-12-15 Thread Simon
Hi,

I think the following should work with the following caveats:
- there's a small danger that if the server blows up before it
releases the lock, that no threads would be able to update your cache,
but since it's only a cache of data. This is easily mitigated by
introducing a task which periodically resets the lock.
- I still believe that there's the possibility that separate instances
will get a non-updated object, even if you use the locking, since I'm
assuming it takes x-amount of time for the changes in MemCache to
propagate throughout the instances.  I may be wrong in this assumption
however.

Anyway, your code would go something like:

boolean lockAcquired = false;

try {
lockAcquired = acquireLock();
doStuff();
} finally {
if (lockAcquired) {
releaseLock();
}
}


With the locking code being:

public static boolean acquireLock() {

boolean lockAcquired = true;
try {
while (increment() != 1) {
decrement();
Thread.sleep(500);
}
} catch (Throwable t) {
// Log error
lockAcquired = false;
}

return lockAcquired;
}

public static void releaseLock() {
decrement();
}

private static void decrement() {
MemcacheServiceFactory.getMemcacheService().increment(LOCK,
-1, 0L);
}

private static Long increment() {
return
MemcacheServiceFactory.getMemcacheService().increment(LOCK, 1, 0L);
}

On Dec 14, 9:56 pm, Jay Young jaydevfollo...@gmail.com wrote:
 Grr.  Just noticed another issue.  The cache item that you get the
 index is not the same item as the lock, so really you need two
 different cache items, one to make sure you have a unique value for
 the lock, and the lock itself.  The code above is correct, you just
 need different keys for the first two cache reads.

 If you can generate a guaranteed-unique name (maybe the thread ID +
 time?), you can drop the first cache item and use that as the lock
 value.  This would also prevent the issue with the code above if the
 lockIndex item is ever evicted and re-read at the same time (thus
 returning 0 for both), or if it overflows the long.

 (I honestly don't know if this is iron-clad, but intuitively it seems
 like it would work with only very minor edge cases.)

 On Dec 14, 4:08 pm, Andrei Cosmin Fifiiþã andrei.fifi...@gmail.com
 wrote:

  H, super...
  I was thinking of smth like (val mod 2) == 0/1 (true/false), but the lock
  reading wasn't safe.
  Thanks!

  On 14 December 2010 20:57, Jay Young jaydevfollo...@gmail.com wrote:

   Except return lockIndex should just be return true.

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

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



Re: [appengine-java] JavaMail Multipart message with inline images

2010-12-15 Thread Ronald R. DiFrango
Voted and added a comment.  It really is amazing that this simple feature is 
not supported.

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



Re: [appengine-java] JSF: sudden ViewExpiredException on GAE

2010-12-15 Thread Nick Belaevski
I'm currently looking at 
MemcacheService.SetPolicyhttp://code.google.com/appengine/docs/java/javadoc/com/google/appengine/api/memcache/MemcacheService.SetPolicy.html
 trying 
to find out what can be causing the problem. Can please anyone shed some 
light on:

   1. Are changes of HttpSession attributes propagated into memcache first? 
   If 'yes', what is the default SetPolicy then?
   2. How data store service is involved in HttpSession handling?

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



Re: [appengine-java] Re: UserService functionality when run via cron

2010-12-15 Thread Benjamin Grabkowitz
The bug reference would be nice. If only to vote it up.

On Wed, Dec 15, 2010 at 2:10 AM, andrew aute...@gmail.com wrote:

 I submitted a bug on the subject, and it was accepted.

 If you want the bug reference I can find it.

 Andrew

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



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



[appengine-java] Re: Synchronized reads/writes on a memcache variable

2010-12-15 Thread Jay Young
On Dec 15, 8:23 am, Simon qila...@gmail.com wrote:
 since I'm
 assuming it takes x-amount of time for the changes in MemCache to
 propagate throughout the instances.  I may be wrong in this assumption
 however.

I don't think cache data is propagated to the various app instances.
It resides in its own central (distributed) system and all handlers/
tasks/cron/whatever make RPC calls into the cache.

-- 
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: Synchronized reads/writes on a memcache variable

2010-12-15 Thread Jay Young
I considered the increment decrement approach, but it creates a race
condition with the counter.  Having many different threads/tasks
trying to grab the lock at the same time  could increment the number
above one, even when no one has the lock because there is still a
period of time between the increment() and decrement().  Remember,
these are RPC calls going over the network.  If any part of that
interaction is slow, there will be even longer periods between the +1
and -1.  I think this method errs on the side of accidentally locking
when there isn't a lock.  The only negatives I see would apply to any
lock that's implemented in a cache.


On Dec 15, 8:23 am, Simon qila...@gmail.com wrote:
 Hi,

 I think the following should work with the following caveats:
 - there's a small danger that if the server blows up before it
 releases the lock, that no threads would be able to update your cache,
 but since it's only a cache of data. This is easily mitigated by
 introducing a task which periodically resets the lock.
 - I still believe that there's the possibility that separate instances
 will get a non-updated object, even if you use the locking, since I'm
 assuming it takes x-amount of time for the changes in MemCache to
 propagate throughout the instances.  I may be wrong in this assumption
 however.

 Anyway, your code would go something like:

 boolean lockAcquired = false;

 try {
     lockAcquired = acquireLock();
     doStuff();} finally {

     if (lockAcquired) {
         releaseLock();
     }

 }

 With the locking code being:

     public static boolean acquireLock() {

         boolean lockAcquired = true;
         try {
             while (increment() != 1) {
                 decrement();
                 Thread.sleep(500);
             }
         } catch (Throwable t) {
             // Log error
             lockAcquired = false;
         }

         return lockAcquired;
     }

     public static void releaseLock() {
         decrement();
     }

     private static void decrement() {
         MemcacheServiceFactory.getMemcacheService().increment(LOCK,
 -1, 0L);
     }

     private static Long increment() {
         return
 MemcacheServiceFactory.getMemcacheService().increment(LOCK, 1, 0L);
     }

 On Dec 14, 9:56 pm, Jay Young jaydevfollo...@gmail.com wrote:







  Grr.  Just noticed another issue.  The cache item that you get the
  index is not the same item as the lock, so really you need two
  different cache items, one to make sure you have a unique value for
  the lock, and the lock itself.  The code above is correct, you just
  need different keys for the first two cache reads.

  If you can generate a guaranteed-unique name (maybe the thread ID +
  time?), you can drop the first cache item and use that as the lock
  value.  This would also prevent the issue with the code above if the
  lockIndex item is ever evicted and re-read at the same time (thus
  returning 0 for both), or if it overflows the long.

  (I honestly don't know if this is iron-clad, but intuitively it seems
  like it would work with only very minor edge cases.)

  On Dec 14, 4:08 pm, Andrei Cosmin Fifiiþã andrei.fifi...@gmail.com
  wrote:

   H, super...
   I was thinking of smth like (val mod 2) == 0/1 (true/false), but the lock
   reading wasn't safe.
   Thanks!

   On 14 December 2010 20:57, Jay Young jaydevfollo...@gmail.com wrote:

Except return lockIndex should just be return true.

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

-- 
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: Synchronized reads/writes on a memcache variable

2010-12-15 Thread Simon
I guess it depends on how much throughput you're expecting through the
bit of the system which requires the lock - I agree that if there is
huge contention then this isn't the way to go, although I'd argue that
you should be changing your design anyway since synchronizing across a
distributed architecture for a lot of threads is just unadvisable.

Memcache API calls currently take ~3ms according to the status page -
running a quick (and dirty ;) ) test with 100 threads attempting to
lock using the above method averages out at ~40ms for one of the
threads to obtain the lock.  If the API call times increase from 3 to
10ms, the time taken for one of the threads to obtain the lock
actually decreases to ~30ms!  The biggest risk you run is that because
it isn't FIFO, there may be a large portion of time before a
particular thread obtains the lock and so it may time out.

On Dec 15, 3:06 pm, Jay Young jaydevfollo...@gmail.com wrote:
 I considered the increment decrement approach, but it creates a race
 condition with the counter.  Having many different threads/tasks
 trying to grab the lock at the same time  could increment the number
 above one, even when no one has the lock because there is still a
 period of time between the increment() and decrement().  Remember,
 these are RPC calls going over the network.  If any part of that
 interaction is slow, there will be even longer periods between the +1
 and -1.  I think this method errs on the side of accidentally locking
 when there isn't a lock.  The only negatives I see would apply to any
 lock that's implemented in a cache.

 On Dec 15, 8:23 am, Simon qila...@gmail.com wrote:

  Hi,

  I think the following should work with the following caveats:
  - there's a small danger that if the server blows up before it
  releases the lock, that no threads would be able to update your cache,
  but since it's only a cache of data. This is easily mitigated by
  introducing a task which periodically resets the lock.
  - I still believe that there's the possibility that separate instances
  will get a non-updated object, even if you use the locking, since I'm
  assuming it takes x-amount of time for the changes in MemCache to
  propagate throughout the instances.  I may be wrong in this assumption
  however.

  Anyway, your code would go something like:

  boolean lockAcquired = false;

  try {
      lockAcquired = acquireLock();
      doStuff();} finally {

      if (lockAcquired) {
          releaseLock();
      }

  }

  With the locking code being:

      public static boolean acquireLock() {

          boolean lockAcquired = true;
          try {
              while (increment() != 1) {
                  decrement();
                  Thread.sleep(500);
              }
          } catch (Throwable t) {
              // Log error
              lockAcquired = false;
          }

          return lockAcquired;
      }

      public static void releaseLock() {
          decrement();
      }

      private static void decrement() {
          MemcacheServiceFactory.getMemcacheService().increment(LOCK,
  -1, 0L);
      }

      private static Long increment() {
          return
  MemcacheServiceFactory.getMemcacheService().increment(LOCK, 1, 0L);
      }

  On Dec 14, 9:56 pm, Jay Young jaydevfollo...@gmail.com wrote:

   Grr.  Just noticed another issue.  The cache item that you get the
   index is not the same item as the lock, so really you need two
   different cache items, one to make sure you have a unique value for
   the lock, and the lock itself.  The code above is correct, you just
   need different keys for the first two cache reads.

   If you can generate a guaranteed-unique name (maybe the thread ID +
   time?), you can drop the first cache item and use that as the lock
   value.  This would also prevent the issue with the code above if the
   lockIndex item is ever evicted and re-read at the same time (thus
   returning 0 for both), or if it overflows the long.

   (I honestly don't know if this is iron-clad, but intuitively it seems
   like it would work with only very minor edge cases.)

   On Dec 14, 4:08 pm, Andrei Cosmin Fifiiþã andrei.fifi...@gmail.com
   wrote:

H, super...
I was thinking of smth like (val mod 2) == 0/1 (true/false), but the 
lock
reading wasn't safe.
Thanks!

On 14 December 2010 20:57, Jay Young jaydevfollo...@gmail.com wrote:

 Except return lockIndex should just be return true.

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

-- 
You received this message 

[appengine-java] storing unowned objects(one to many) in datastore

2010-12-15 Thread kartik kudada
Can we store two unowned objects(one to many) in datastore in a single
transaction.
For example -  We have

public class Person {
@PrimaryKey
 @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Long id;

@Persistent
private String name;

@Persistent
 private ListKey mobileIds =  new ArrayListKey();

   //
  //.
  }

public class Mobile {

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

  // ...
 //
}


I want to store these two objects in datastore in single transaction so that
relation  can be made in between both objects.
Tell me if any other solution is 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] Re: Does the local unit test framework use the same datastore-indexes.xml file as the app?

2010-12-15 Thread Huy
Also, a coworker was able to consistently generate a missing index exception 
from a local unit test, but I couldn't reproduce using the same code, so it 
doesn't seem we can rely on this mechanism to test our indexes until we 
figure out what's happening here.

-- 
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] GWT and GAE debugging problem

2010-12-15 Thread kidowell
Hey.

Im starting with GAE, and im making an RCP program (a book address), on the 
server side I've got all the methods for manipulating the datastore (I'm 
using JPA), and on the client side I'm using GWT as a framework.

When debugging it turns out, that I can only see the server side, and 
program never stops in any breakpoint on the client side.

Is there any way that I can debug on both side sas the program runs. 
Because, just debugging on the server side is not very helpful.

Thank you in advanced for your recomendation.

Kido.

-- 
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: Synchronized reads/writes on a memcache variable

2010-12-15 Thread Jay Young
On Dec 15, 10:50 am, Simon qila...@gmail.com wrote:
 although I'd argue that
 you should be changing your design anyway since synchronizing across a
 distributed architecture for a lot of threads is just unadvisable.

No doubt.  I was simply commenting on the method in question.

-- 
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: Memcache entries - available how soon after entry?

2010-12-15 Thread Tom Phillips
So using UUID's class scope static variables I can now tell which JVM
services each request.

What I've confirmed is that at least when using reserved instances
(Always On), Memcache entries are only found within the same JVM
instance that created the cache entry. So I only get a cache hit if
the next request goes to that same JVM.

Is this expected behavior from Memcache, or should I raise a bug
report? I pictured a highly-distributed memory cache available to the
entire application. If it's per-JVM, I'm not sure why one wouldn't
just use a Singleton or something to cache data, or why GAE RPC would
be required when invoking the Memcache API.

Thanks,
Tom

On Dec 14, 11:33 pm, Tom Phillips tphill0...@gmail.com wrote:
 I'm seeing unexpected (to me) Memcache behavior in my app ever since I
 enabled reserved instances (which I did first thing after 1.4.0). When
 one request adds a cache entry, subsequent requests anywhere from
 10-60 seconds after are only able to find the entry sporadically.

 The cache is very lightly used and no expiry is set. I know that the
 correct key is being used by the writer and readers.

 The followup requests could be being handled by different JVM
 instances than the writer, but I wouldn't think this would make a
 difference. I'm not sure how to tell which instance services which
 request, I just now the request sequence. For all I know, the times it
 does find the cache entry might be only when serviced by the same JVM
 as the writer.

 Shouldn't Memcache entries be available to readers immediately after
 addition, and presumably available to all JVM instances? If not
 immediately for some reason, shouldn't they be available with 60
 seconds?

 Thanks for any insight,
 Tom

-- 
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] GWT Designer for NetBeans

2010-12-15 Thread kidowell
Hey, is there any gwt designer for NetBeans out there?.

It would be nice to place all the design and receive automatically the code 
for it.

I have read theres a plugin for Eclipse but I can't find anything for 
NetBeans.

Any sugestion?.

Cheers.

Kido.

-- 
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] url fetch quota: ResponseTooLargeException

2010-12-15 Thread Sydney
Hello, 

I got a ResponseTooLargeException when using the url fetch service. I 
checked the quota (
http://code.google.com/appengine/docs/java/urlfetch/overview.html#Quotas_and_Limits)
 and 
my request and response are within these quotas. Here is the response header 
when fetching the url in a browser:

Date Wed, 15 Dec 2010 23:45:05 GMT
Server Microsoft-IIS/6.0
X-Powered-By ASP.NET
X-AspNet-Version 2.0.50727
Cache-Control private
Content-Type text/xml; charset=utf-8
Content-Length 1141487

My app is not deployed on app engine, so I just tested locally. I am using 
app engine 1.4.0

Thanks

-- 
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: GWT Designer for NetBeans

2010-12-15 Thread Didier Durand
Hi,

A more appropriate place to post this question is
http://groups.google.com/group/google-web-toolkit
regards
didier

On Dec 15, 8:03 pm, kidowell crui...@gmail.com wrote:
 Hey, is there any gwt designer for NetBeans out there?.

 It would be nice to place all the design and receive automatically the code
 for it.

 I have read theres a plugin for Eclipse but I can't find anything for
 NetBeans.

 Any sugestion?.

 Cheers.

 Kido.

-- 
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: url fetch quota: ResponseTooLargeException

2010-12-15 Thread Didier Durand
Hi,

According to 
http://code.google.com/appengine/docs/java/tools/devserver.html#Using_URL_Fetch,
there may be differences between dev server and real infrastructure.
So, if I were you, I would quickly upload and make a test from the
live env and see what happens.

Let us know

regards

didier
On Dec 16, 1:07 am, Sydney sydney.henr...@gmail.com wrote:
 Hello,

 I got a ResponseTooLargeException when using the url fetch service. I
 checked the quota 
 (http://code.google.com/appengine/docs/java/urlfetch/overview.html#Quo...) and
 my request and response are within these quotas. Here is the response header
 when fetching the url in a browser:

 Date Wed, 15 Dec 2010 23:45:05 GMT
 Server Microsoft-IIS/6.0
 X-Powered-By ASP.NET
 X-AspNet-Version 2.0.50727
 Cache-Control private
 Content-Type text/xml; charset=utf-8
 Content-Length 1141487

 My app is not deployed on app engine, so I just tested locally. I am using
 app engine 1.4.0

 Thanks

-- 
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: storing unowned objects(one to many) in datastore

2010-12-15 Thread Didier Durand
Hi,

If they don't belong to the same entity group, you will raise an
exception by trying to store 2 objects in a single transaction.

2 ways to handle that:

   a) you make Mobile belong to same entity group as Person so you'll
be able to store both in a single transaction. I understand in your
question that you can't go this way.
   b) you store one let's say Person in first transaction and during
this transaction, you start a task as part of the transaction: You
can enqueue a task as part of a datastore transaction, such that the
task is only enqueued—and guaranteed to be enqueued—if the transaction
is committed successfully. Tasks added within a transaction are
considered to be a part of it and have the same level of isolation and
consistency. as said in 
http://code.google.com/appengine/docs/java/taskqueue/overview.html#Tasks_Within_Transactions

Hope it helps

didier



On Dec 15, 8:26 am, kartik kudada kartik.kud...@gmail.com wrote:
 Can we store two unowned objects(one to many) in datastore in a single
 transaction.
 For example -  We have

 public class Person {
 @PrimaryKey
 �...@persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
 private Long id;

 @Persistent
 private String name;

         @Persistent
  private ListKey mobileIds =  new ArrayListKey();

    //
   //.
   }

 public class Mobile {

         �...@primarykey
 @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
  private Key mobileId;

   // ...
  //

 }

 I want to store these two objects in datastore in single transaction so that
 relation  can be made in between both objects.
 Tell me if any other solution is 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] Re: how to open an instance of a class

2010-12-15 Thread Didier Durand
Hi,

What you are trying to achieve is based on the reflection capabilities
of Java and mainly the class java.lang.Class. (See
http://download.oracle.com/javase/1.5.0/docs/api/java/lang/Class.html)

To describe it shortly:

a) use static method forName: Class.forName(yourClassName)
b) then use reflection on the object of class Class that will be
returned:
   class.getConstructors() to get the constructor you need
c) read http://download.oracle.com/javase/tutorial/reflect/class/index.html
and http://download.oracle.com/javase/tutorial/reflect/member/index.html
to discover the next steps.

This is fully possible as App Engine gives access to the reflection
API of Java. I personnally use this API on GAE.

regards

didier

On Dec 14, 10:41 pm, Abdel_eid a.eid.1...@gmail.com wrote:
 Dear All ,
    I am working on a project in which the user enters the class name
 and data that he needs to add to the data store but i faced a big
 problem , i had successfully read the data from the user and checked
 it's correctness but i am trying to open a new instance of the class
 send by the user in the form of String

 for example String class_name = Student;
 String final_class_name = package_name + class_name;

 so how can i open an object of that sent class and also send the
 caught variables to it's constructor
 N.B i don't know how many classes i had or there name to check it with
 ( instance of )

 Thanks for your attention

-- 
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: JSP compiling fails after upgrade from 1.3.8 to 1.4.0

2010-12-15 Thread Chris Keller
Note that the previous post only applies to my local development 
environment. I just tried using the new version of the SDK on the production 
server, and it has no problems.

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