[appengine-java] Re: return an empty result from jdo query,any help?

2011-01-20 Thread Ian Marshall
Near the line

  q.setRange(pageModel.getStartPos()-1, pageModel.getEndPos());

in your findByType(...) method

have you tried checking the values

  pageModel.getStartPos() - 1

and

  pageModel.getEndPos()

just to verify that they hold valid values?

You could also try

  q.setRange(0, 1);

instead, just to verify that all your other datastore exchange code
works.


On Jan 20, 4:58 am, ice_str...@163.com wrote:
> the getAll() method is ok, but findByType() method will fail.

-- 
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: Struggling w/datastore relationship

2011-01-20 Thread WillSpecht
Just add a Tags list to User and a User list to Tag.  This way you can
search for Users with a given tag or Tags that has been used by a
given user. Its still the same structure you just add another set of
lists.  If you do this, you will be able to quickly process each query
you listed in your original post.  If you are still looking to do
more,  another possible query that you wouldn't be able to do with
this structure would be helpful.

I'm not totally sure about the upper limit of the index, I've never
had a system that approached them.

On Jan 19, 4:39 pm, Benjamin Carlson  wrote:
> Thanks much for the link! It doesn't directly answer my issue, but it did
> give me a few more ideas about how to go about this... I've watched it three
> times (so far)! :)
>
> Despite seeing the merge-join in action, I don't think it quite matches my
> model, so I'm trying to visualize how to make my data match one of these
> models... and that's not working so far either. Anyone else have ideas? The
> issue that isn't addressed is the third relationship... everything
> demonstrated and talked about in these slides only discuss two
> relationships, and it doesn't appear that a third would work (or at least
> not very well!).
>
> Also, the limit _is_ over 2000, but sounds like it's 5000 per index. The
> extended index class is pretty interesting, but I'm not completely
> understanding that either... does that mean I create a new instance of the
> index class each time I reach 5000 entries? Or does it mean I create a new
> index class itself (i.e. three instances of userIndexClass or one instance
> of each of userIndexClassOne, userIndexClassTwo and userIndexClassThree)?
>
> Thanks again!
>
> -Ben

-- 
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: passing multiple parameters to JDOQL

2011-01-20 Thread Vik
hie

any updates on this please?

Thankx and Regards

Vik
Founder
www.sakshum.com
www.sakshum.blogspot.com


On Wed, Jan 5, 2011 at 9:58 AM, Vik  wrote:

> Hie
>
> Thanks..
>
> This worked for me. But how do i print the complete query executed in the
> logs when this approach is used?
>
>
> Thankx and Regards
>
> Vik
> Founder
> www.sakshum.com
> www.sakshum.blogspot.com
>
>
> On Thu, Dec 30, 2010 at 9:43 PM, Yegor  wrote:
>
>> >   query.declareParameters("Long bind_pocId, Date bind_startDate, Date
>> > bind_endDate");
>>
>> This is correct. However, I personally prefer the shorter form, where
>> instead of using filter "column == alias" along with
>> query.declareParameters("Type alias") you just use filter "column
>> == :alias" (note the colon before the alias name). Your query can be
>> rewritten as follows:
>>
>> Query query = pm.newQuery(PocVacationSchedule.class);
>> query.setFilter("pocId == :pi && startDate == :sd && endDate == :ed");
>> List rulesList = (List)
>> query.execute(pocId, startFrom, endFrom);
>>
>> --
>> 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] MemcacheService always returns null

2011-01-20 Thread Dave
(cross posted from 
http://stackoverflow.com/questions/4743534/appengine-memcache-always-returns-null)

I can't seem to figure out why, but I get a cache miss on memcache on
every single attempt. I'm using a framework that abstracts away the
actual call to the memcache service; however, even when I use it
directly it doesn't work. On my Quota details, I see that memcache has
registered API calls and data sent but no data received from API.

I've done some more testing and found that the put calls were failing
silently (not even the log message you normally get) because of
unserializable types in the class. I fixed this and it continued to
fail. However, after changing the implementation from MemcacheService
to JCache, it started working again.  Any ideas? I'd rather not use
JCache.

-- 
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: 620 Error with Google Geocoding service

2011-01-20 Thread culov
This isn't possible in my case because the geocoding is part of the
data generation process.

On Jan 19, 7:02 pm, Matt Farnell  wrote:
> I'd suggest you do the geocoding on the clients browser and pass the
> results back to your server if you need them.
>
>
>
>
>
>
>
> On Wed, Jan 19, 2011 at 9:12 AM, Didier Durand  
> wrote:
> > Hi,
>
> > I think that you've more chances of getting heard by going to
> >http://groups.google.com/group/google-maps-apior one of the other
> > groups mentionned on the page of this url.
>
> > regards
>
> > didier
>
> > On Jan 19, 6:09 pm, culov  wrote:
> >> This has happened many times before and its happening again.  I can't
> >> geocode anything successfully from my GAE Java app because a 620 error
> >> is ALWAYS returned.  Please fix!
>
> > --
> > 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 
> > athttp://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] aggregating tasks and executing them at once? (task queues?)

2011-01-20 Thread Ivan
Hi guys,

What is the best way to batch time-non-critical datastore operations?
The use case is the following:

In my app users can perform certain actions, which result in news
items being generated: 0 - 4 per action, depending on the action.
Currently I put them immediately to the datastore in a batch put. What
would be much more optimal is to somehow batch them in groups
(although they were created in totally different contexts, probably
gae instances as well) and persist them as soon as group size > X or
time elapsed since group was created > Y mins. My impression is that
task queues are a good candidate but at the moment they rather serve
to split a big task into smaller ones rather than vice versa. Any
suggestions on how to optimize the above problem?

Cheers,
Ivan

-- 
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] Key only query

2011-01-20 Thread Kenny
According to:
http://code.google.com/appengine/docs/java/datastore/jdo/queries.html#Queries_on_Keys

We are suppose to be able to get Key only query.  But according to
this:
http://groups.google.com/group/google-appengine/browse_thread/thread/c9ef645f0f77a53e

Key only result doesn't work.  Has any one tried this and got it
working?  I gave it a try and I got the result like the second case.
I got the error:

javax.jdo.JDOUserException: Illegal result clause : PrimaryExpression
should be a VariableExpression with name id

Now... my attempt have an additional filter on the query.  Does that
matter?

-- 
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] Key only query

2011-01-20 Thread Stephen Johnson
Yes, it works. I use key only queries a lot.  I could help more if you
posted the code with the query.

On Wed, Jan 19, 2011 at 6:52 AM, Kenny  wrote:

> According to:
>
> http://code.google.com/appengine/docs/java/datastore/jdo/queries.html#Queries_on_Keys
>
> We are suppose to be able to get Key only query.  But according to
> this:
>
> http://groups.google.com/group/google-appengine/browse_thread/thread/c9ef645f0f77a53e
>
> Key only result doesn't work.  Has any one tried this and got it
> working?  I gave it a try and I got the result like the second case.
> I got the error:
>
> javax.jdo.JDOUserException: Illegal result clause : PrimaryExpression
> should be a VariableExpression with name id
>
> Now... my attempt have an additional filter on the query.  Does that
> matter?
>
> --
> 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: aggregating tasks and executing them at once? (task queues?)

2011-01-20 Thread Didier Durand
Hi,

I don't see how you will save: puts are unitary actions -> they can
not be optimized like queries for big sets of data. By using a task,
you will add the cost of saving / starting / running a task to the
cost of your put operation that you will do anyway.

In addition, you may even generate more contentions on the datastore
servers if your puts go all to the same server. So, more cpus,
additional contention exceptions to handle, etc...

Really, if you puts are spread, I would try to let them so.

Spread writes are usually simpler to handle than concentrated ones.

Did I miss something ?

regards
didier

On Jan 20, 12:18 pm, Ivan  wrote:
> Hi guys,
>
> What is the best way to batch time-non-critical datastore operations?
> The use case is the following:
>
> In my app users can perform certain actions, which result in news
> items being generated: 0 - 4 per action, depending on the action.
> Currently I put them immediately to the datastore in a batch put. What
> would be much more optimal is to somehow batch them in groups
> (although they were created in totally different contexts, probably
> gae instances as well) and persist them as soon as group size > X or
> time elapsed since group was created > Y mins. My impression is that
> task queues are a good candidate but at the moment they rather serve
> to split a big task into smaller ones rather than vice versa. Any
> suggestions on how to optimize the above problem?
>
> Cheers,
> Ivan

-- 
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] How to simulate transactional behaviour for two root entites?

2011-01-20 Thread ss.require
I have the next problem:
My app has thousands of users. Every user has money that can be
represented as the "money" field in the "User" entity. If a payable
event occurs in the app then I have to make a payment between two
users so I need to update "money" fields for two "User" entities in a
transaction. But I can't do it in a transaction because each user is
in a different entity group and on the other hand I cann't put two
users in a single entity group, because thus the single entity group
will have all users and datastore contention problem will arise.

I can't figure out how this use case can be implemented correctly or
how to design a datastore model.
Please, suggest best practices for this situation!

-- 
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 simulate transactional behaviour for two root entites?

2011-01-20 Thread Didier Durand
Hi,

The usual way is to launch a task included in the 1st transaction for
the second update.

See 
http://code.google.com/appengine/docs/java/taskqueue/overview.html#Tasks_Within_Transactions

You have the guarantee that the task is enqueued only if the 1st
update succeeds. What is not guaranteed though is a rollback on the
1st update if the second fails or can't happen. You have to manage
this case by yourself probably via a 3rd task that you schedule when
the second fails.

regards

didier

On Jan 20, 6:58 pm, "ss.require"  wrote:
> I have the next problem:
> My app has thousands of users. Every user has money that can be
> represented as the "money" field in the "User" entity. If a payable
> event occurs in the app then I have to make a payment between two
> users so I need to update "money" fields for two "User" entities in a
> transaction. But I can't do it in a transaction because each user is
> in a different entity group and on the other hand I cann't put two
> users in a single entity group, because thus the single entity group
> will have all users and datastore contention problem will arise.
>
> I can't figure out how this use case can be implemented correctly or
> how to design a datastore model.
> Please, suggest best practices for this situation!

-- 
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 simulate transactional behaviour for two root entites?

2011-01-20 Thread mgenov

You have to use distributed transaction as described in 
http://blog.notdot.net/2009/9/Distributed-Transactions-on-App-Engine

The example is in python, but it can be easily rewritten in java. 

-- 
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] anyone having issues with getServingUrl(blobkey) today?

2011-01-20 Thread Vinny
I keep getting an
"java.lang.IllegalArgumentException: Unknown" error.
when trying to use:
http://code.google.com/appengine/docs/java/javadoc/com/google/appengine/api/images/ImagesService.html#getServingUrl(com.google.appengine.api.blobstore.BlobKey)

I am feeding getServingUrl() a legitimate blobkey and it's string
representation  even works when I append it to a static google url
like :
http://lh3.ggpht.com/myBlobKeyString

sample of my code and the actual key is in the ticket below.

http://code.google.com/p/googleappengine/issues/detail?id=4435

just wanted to see if I was the only one.


--
biz: http://www.linkedin.com/in/vincentstoessel/
personal: http://www.xaymaca-studios.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 simulate transactional behaviour for two root entites?

2011-01-20 Thread ss.require
First of all, thanks very much for quick and reasonable replys!

--What is not guaranteed though is a rollback on the
--1st update if the second fails or can't happen
But it is guaranteed that the 2nd update can be rolled forward once to
infinity or the 1st update can be rolled back(probably via a 3rd task)
once to infinity. To accomplish that we should configure the queue to
retry every e.g. 20 sec. and retring will continue to infinity unless
the task is fulfiled. From this perspective my use case can be
considered consistent for the duration of infinity. Am I right?

--You have to use distributed transaction as described in
--http://blog.notdot.net/2009/9/Distributed-Transactions-on-App-Engine
Actually the approach in this article is the same as Didier described
except we should manually controll rolling forward(back) in our code.
So it is better to use Didier's method because every method doesn't
have any advantages over other but Didier's method is more easy to
implement. Am I right?

Anyway, these methods don't guarante real transactional consistency.
And as far I understand there is not any other real transactional
solution. Am I right?

-- 
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: passing multiple parameters to JDOQL

2011-01-20 Thread A. Stevko
re: how do i print the complete query executed in the logs when
this approach is used?

Simple. Print the query string and then print the parameters.


On Thu, Jan 20, 2011 at 6:35 AM, Vik  wrote:

> hie
>
> any updates on this please?
>
> Thankx and Regards
>
> Vik
> Founder
> www.sakshum.com
> www.sakshum.blogspot.com
>
>
> On Wed, Jan 5, 2011 at 9:58 AM, Vik  wrote:
>
>> Hie
>>
>> Thanks..
>>
>> This worked for me. But how do i print the complete query executed in the
>> logs when this approach is used?
>>
>>
>> Thankx and Regards
>>
>> Vik
>> Founder
>> www.sakshum.com
>> www.sakshum.blogspot.com
>>
>>
>> On Thu, Dec 30, 2010 at 9:43 PM, Yegor  wrote:
>>
>>> >   query.declareParameters("Long bind_pocId, Date bind_startDate, Date
>>> > bind_endDate");
>>>
>>> This is correct. However, I personally prefer the shorter form, where
>>> instead of using filter "column == alias" along with
>>> query.declareParameters("Type alias") you just use filter "column
>>> == :alias" (note the colon before the alias name). Your query can be
>>> rewritten as follows:
>>>
>>> Query query = pm.newQuery(PocVacationSchedule.class);
>>> query.setFilter("pocId == :pi && startDate == :sd && endDate == :ed");
>>> List rulesList = (List)
>>> query.execute(pocId, startFrom, endFrom);
>>>
>>> --
>>> 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.
>



-- 
-- A. Stevko
===
"If everything seems under control, you're just not going fast enough." M.
Andretti

-- 
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: Struggling w/datastore relationship

2011-01-20 Thread Benjamin Carlson
I just came across this document:

http://www.scribd.com/doc/24330945/No-Relation-The-Mixed-Blessings-of-Non-Relational-Databases

It helps, but doesn't completely answer my question. It would appear that 
what I'm wanting to do is an EAV (entities/attributes/values) type 
relationship, however, I'm still not clear on how to do so in GAE/J and 
still be able to query how I need to.

As for adding a list to each of User and Tag, it doesn't keep the 
relationship between the User, Tag AND URL... just two of the three... 
that's what's causing me heartburn here... :) Or, perhaps it does, and I'm 
too relationally-minded to see it? 

Thanks!

-Ben

-- 
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: passing multiple parameters to JDOQL

2011-01-20 Thread Vik
Well That's fine But I would be more interested in logging the exact
query fired by engine instead of separately printing individual stuff.

The individual printing these elements this way is painful as well in the
development process. So, any better way to print the query exactly fired by
engine?


Thankx and Regards

Vik
Founder
www.sakshum.com
www.sakshum.blogspot.com


On Fri, Jan 21, 2011 at 3:49 AM, A. Stevko  wrote:

> re: how do i print the complete query executed in the logs when
> this approach is used?
>
> Simple. Print the query string and then print the parameters.
>
>
> On Thu, Jan 20, 2011 at 6:35 AM, Vik  wrote:
>
>> hie
>>
>> any updates on this please?
>>
>> Thankx and Regards
>>
>> Vik
>> Founder
>> www.sakshum.com
>> www.sakshum.blogspot.com
>>
>>
>> On Wed, Jan 5, 2011 at 9:58 AM, Vik  wrote:
>>
>>> Hie
>>>
>>> Thanks..
>>>
>>> This worked for me. But how do i print the complete query executed in the
>>> logs when this approach is used?
>>>
>>>
>>> Thankx and Regards
>>>
>>> Vik
>>> Founder
>>> www.sakshum.com
>>> www.sakshum.blogspot.com
>>>
>>>
>>> On Thu, Dec 30, 2010 at 9:43 PM, Yegor  wrote:
>>>
 >   query.declareParameters("Long bind_pocId, Date bind_startDate, Date
 > bind_endDate");

 This is correct. However, I personally prefer the shorter form, where
 instead of using filter "column == alias" along with
 query.declareParameters("Type alias") you just use filter "column
 == :alias" (note the colon before the alias name). Your query can be
 rewritten as follows:

 Query query = pm.newQuery(PocVacationSchedule.class);
 query.setFilter("pocId == :pi && startDate == :sd && endDate == :ed");
 List rulesList = (List)
 query.execute(pocId, startFrom, endFrom);

 --
 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.
>>
>
>
>
> --
> -- A. Stevko
> ===
> "If everything seems under control, you're just not going fast enough." M.
> Andretti
>
>
>
>
>
>  --
> 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: How to simulate transactional behaviour for two root entites?

2011-01-20 Thread Didier Durand
Hi,

Your your way of rolling back: yes, second task and infinity for limit
and that should do it.

My only worry was about the semantics: some operations can't be rolled
back as easily as a subtraction if you just made an add. If your
calculations are more complex it may some time be hard to roll back.
The other possible issue if is a another data in another entity group
has been modified based on your first operation when the second fails.
You may not know it and then be unable to roll it back also...

As said, it's all a question of appl semantics: if semantics is
simple, then fine. If not, the double transaction trick may not be
enough.

cheers

didier

On Jan 20, 9:29 pm, "ss.require"  wrote:
> First of all, thanks very much for quick and reasonable replys!
>
> --What is not guaranteed though is a rollback on the
> --1st update if the second fails or can't happen
> But it is guaranteed that the 2nd update can be rolled forward once to
> infinity or the 1st update can be rolled back(probably via a 3rd task)
> once to infinity. To accomplish that we should configure the queue to
> retry every e.g. 20 sec. and retring will continue to infinity unless
> the task is fulfiled. From this perspective my use case can be
> considered consistent for the duration of infinity. Am I right?
>
> --You have to use distributed transaction as described in
> --http://blog.notdot.net/2009/9/Distributed-Transactions-on-App-Engine
> Actually the approach in this article is the same as Didier described
> except we should manually controll rolling forward(back) in our code.
> So it is better to use Didier's method because every method doesn't
> have any advantages over other but Didier's method is more easy to
> implement. Am I right?
>
> Anyway, these methods don't guarante real transactional consistency.
> And as far I understand there is not any other real transactional
> solution. Am I right?

-- 
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] storing utf-16 in the GAE datastore

2011-01-20 Thread Brother
I am receiving UTF-16 characters I must register in the database. Right now, 
it seems to convert into UTF-8. I am using JPA+annotation
Any help appreciated

-- 
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: Struggling w/datastore relationship

2011-01-20 Thread WillSpecht
So you want to be able to find all URL's saved by a User that have a
certain Tag? Or, all the Users that have Tagged "Tech" to a URL? Or,
all the Tags given a URL by a certain User?

This can be done with our Model.  It's actually what the second part
of the video in the link is about.

Merge Join

All you need to do is add a second filter.

not sure if the syntax is:

query.setFilter("urlId == urlParam");

or

query.setFilter("urlId == urlParam && userId == userParam");


This query would return all the Tags that a specific User put on a
specific URL.


I hope this is what you were looking for.

On Jan 20, 5:39 pm, Benjamin Carlson  wrote:
> I just came across this document:
>
> http://www.scribd.com/doc/24330945/No-Relation-The-Mixed-Blessings-of...
>
> It helps, but doesn't completely answer my question. It would appear that
> what I'm wanting to do is an EAV (entities/attributes/values) type
> relationship, however, I'm still not clear on how to do so in GAE/J and
> still be able to query how I need to.
>
> As for adding a list to each of User and Tag, it doesn't keep the
> relationship between the User, Tag AND URL... just two of the three...
> that's what's causing me heartburn here... :) Or, perhaps it does, and I'm
> too relationally-minded to see it?
>
> Thanks!
>
> -Ben

-- 
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] Hebrew characters are messed up when receiving MimeMessage

2011-01-20 Thread all . ezra . hoch
I have an email handler that does the following:

Properties props = new Properties(); 
Session session = Session.getDefaultInstance(props, null); 
MimeMessage message = new MimeMessage(session, req.getInputStream());
String content = getContent(message);

where getContent is:

private String getContent(MimeMessage message) throws MessagingException, 
IOException {
Object content = message.getContent();
 if (content instanceof String) 
return (String)content;
 if (content instanceof Multipart)
return getContent((Multipart)content);
 return "";
}
private String getContent(Multipart multi) throws MessagingException, 
IOException {
// Get plain text of message
for (int i = 0; i < multi.getCount(); i++) {
if 
(multi.getBodyPart(i).getContentType().toUpperCase().startsWith(LedUtils.TEXT_PLAIN_CONTENT_TYPE.toUpperCase()))
 
{
return (String)multi.getBodyPart(i).getContent();
} // if
} // for
 return "";
}

My problem is this:
When someone sends my handler an email with Hebrew characters in it, the 
content I receive is partly jibrished. 
However, if the message contains only one or two words in Hebrew, it usually 
returns a valid content (i.e., all characters are ok).

Any ideas?

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