[appengine-java] Discussion on will-it-play-in-app-engine

2010-10-20 Thread Cornel Creanga
BlazeDS messaging does not work on GAE.

-- 
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] JDO bug - won't persist parent class attributes - has it been fixed?

2009-09-23 Thread Cornel

I remember there was a bug denoted somewhere in the documentation
(http://code.google.com/appengine/docs/java/datastore ) that JDO won't
persist properties/attributes of the parent classes. Has this been
fixed in the latest release?

--
Corneliu
--~--~-~--~~~---~--~~
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] Merge join + Key Name used to emulate sort field

2009-09-23 Thread Cornel

Hello!

I recently discovered the power of merge joins on app-engine (no more
composite indexes required! hurray!).
I am also aware that i cannot inequality filters, neither order
clauses.

But what if i generate the primary key of the entities using the
values of the field i wish to order by. This way, since entities are
ordered (by default) by key ascending, it means they will effectively
be ordered by my criteria.

I also realized that this would work only for entities with no
parents. Otherwise the parent part of the key will mess things up (it
is compared first and this will determine the real order! which is not
what i need/want); solution - no parents ;)

Quote from compareTo() method of Key:
The relationship between individual Key Keys is performed by
comparing app followed by kind followed by id. If both keys are
assigned names rather than ids, compares names instead of ids. If
neither key has an id or a name we return an arbitrary but consistent
result. Assuming all other components are equal, all ids are less than
all names. 


More specifically: if both keys are assigned names rather than ids,
compares names instead of ids. Are names compared lexically? It seems
so, but i want to be sure. Can you tell me?


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



[appengine-java] JDO vs low level API

2009-09-21 Thread Cornel

Hello!

I would like to bring in discussion a comparison between JDO and the
low level API. Google recommends using the low-level API only to
framework developers, but JDO seems to inflexible to me.

I've been using JDO for a month now and i've come across some nasty
limitations. I will mention a few here:

The datastore itself is very flexible: you can have an entity called
SimpleObject with property1name and propery2name and another
SimpleObject with property1name and propery3name! A low level
API query for entities of kind SimpleObject will fetch both. In JDO,
i simply cannot define two objects with the same name SimpleObject
and different properties, so i cannot take advantage of this feature
that the datastore offers!

JDO offers Owned One-to-Many Relationships by defining a List of
objects that will be persisted as the children of the current object;
also one can manipulate these objects by calls to List methods. But
what if i want to say list.get(50.000) ? How is this implemented?
Will it try to bring all 50.000 entities in memory (and fail?!), or
will it bring only the 50.000th one? In the latter case, how does it
count to 50.000, because the low level API doesn't offer support for
limit 1 offset 49.999 (it's above the 1000 limit)

Or let's say i need to get the child from that list, that satisfies a
certain condition: get the 5th child that has propertyX='y' ; in
pseudo-code something like this: list.get('propertyx', OP_EQUALS, 'y',
5). There is no such thing obviously; i should use a query instead:
select * from SimpleObjectChild where propertyX = 'y' and ancestor is
_simpleobjectkey_ which is fine. My question is: since i need to use
queries for more complicated issues, why bother with the list
declaration :), if i will never use the plain old list.get(i).

You might suggest iterating through the list:
for (SimpleObjectChild soc: List) {
if (soc.properyX.equals(y) {
do_something();
}
}
But isn't this prohibitively inefficient?? If i have a list of 100.000
elements, of which only about 100 have propertyX='y', i could fetch
them (very fast) via the query: select * from SimpleObjectChild where
propertyX = 'y' and ancestor is _simpleobjectkey_, then operate on
them.

Regarding JDO Extent, it's also very inefficient (in my opinion)! See
following example:

doit() {
for (DbContact db : extent) {
if (db.getVersion().equals(0.0)) {
do_stuff();
db.setVersion(0.2);
}
}
}

If i have a list of 100.000 elements, and have already handled 75.000
of them on previous calls (there is the 30 second limit to a call, not
enough time to handle all entities in a call); then, on a successive
call, the extent will also pass through version 2.0 entities,
wasting time, and maybe even never reaching a version 1.0 entity
within the 30 seconds allowed.

Instead i took the following approach:
(AdvancedQuery is a simple wrapper made by me, over JDO Query)

I am using a query, that always fetches the first 50 (could be any
number) unhandled objects so far. It is written in JDO, but can just
as easily be written in the low level API.

doit() {
AdvancedQuery aq = new AdvancedQuery(pm.newQuery
(DbRawContact.class));
aq.addFilter(version, ==, 0.1);
if (!firstRun) {
aq.addFilter(encodedKey, , lastKey);
}
aq.appendOrdering(encodedKey ascending);
aq.setLimit(50);
List DbRawContact results = (ListDbRawContact) aq.execute();
for (DbRawContact db : results) {
do_stuff();
db.setVersion(0.2);
lastkey = db.key;
}
return lastkey;
}



I am seriously thinking of developing my own framework based on the
low-level API to take advantage of it's full power and flexibility. I
know what the pros are (power and flexibility), i'm asking are there
any cons? :) (besides, perhaps, longer developing time and effort on
my behalf)

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



[appengine-java] JDO vs low level API

2009-09-21 Thread Cornel

Hello!

I would like to bring in discussion a comparison between JDO and the
low level API. Google recommends using the low-level API only to
framework developers, but JDO seems to inflexible to me.

I've been using JDO for a month now and i've come across some nasty
limitations. I will mention a few here:

The datastore itself is very flexible: you can have an entity called
SimpleObject with property1name and propery2name and another
SimpleObject with property1name and propery3name! A low level
API query for entities of kind SimpleObject will fetch both. In JDO,
i simply cannot define two objects with the same name SimpleObject
and different properties, so i cannot take advantage of this feature
that the datastore offers!

JDO offers Owned One-to-Many Relationships by defining a List of
objects that will be persisted as the children of the current object;
also one can manipulate these objects by calls to List methods. But
what if i want to say list.get(50.000) ? How is this implemented?
Will it try to bring all 50.000 entities in memory (and fail?!), or
will it bring only the 50.000th one? In the latter case, how does it
count to 50.000, because the low level API doesn't offer support for
limit 1 offset 49.999 (it's above the 1000 limit)

Or let's say i need to get the child from that list, that satisfies a
certain condition: get the 5th child that has propertyX='y' ; in
pseudo-code something like this: list.get('propertyx', OP_EQUALS, 'y',
5). There is no such thing obviously; i should use a query instead:
select * from SimpleObjectChild where propertyX = 'y' and ancestor is
_simpleobjectkey_ which is fine. My question is: since i need to use
queries for more complicated issues, why bother with the list
declaration :), if i will never use the plain old list.get(i).

You might suggest iterating through the list:
for (SimpleObjectChild soc: List) {
   if (soc.properyX.equals(y) {
   do_something();
   }
}
But isn't this prohibitively inefficient?? If i have a list of 100.000
elements, of which only about 100 have propertyX='y', i could fetch
them (very fast) via the query: select * from SimpleObjectChild where
propertyX = 'y' and ancestor is _simpleobjectkey_, then operate on
them.

Regarding JDO Extent, it's also very inefficient (in my opinion)! See
following example:

doit() {
   for (DbContact db : extent) {
   if (db.getVersion().equals(0.0)) {
   do_stuff();
   db.setVersion(0.2);
   }
   }
}

If i have a list of 100.000 elements, and have already handled 75.000
of them on previous calls (there is the 30 second limit to a call, not
enough time to handle all entities in a call); then, on a successive
call, the extent will also pass through version 2.0 entities,
wasting time, and maybe even never reaching a version 1.0 entity
within the 30 seconds allowed.

Instead i took the following approach:
(AdvancedQuery is a simple wrapper made by me, over JDO Query)

I am using a query, that always fetches the first 50 (could be any
number) unhandled objects so far. It is written in JDO, but can just
as easily be written in the low level API.

doit() {
   AdvancedQuery aq = new AdvancedQuery(pm.newQuery
(DbRawContact.class));
   aq.addFilter(version, ==, 0.1);
   if (!firstRun) {
   aq.addFilter(encodedKey, , lastKey);
   }
   aq.appendOrdering(encodedKey ascending);
   aq.setLimit(50);
   List DbRawContact results = (ListDbRawContact) aq.execute
();
   for (DbRawContact db : results) {
   do_stuff();
   db.setVersion(0.2);
   lastkey = db.key;
   }
   return lastkey;
}



I am seriously thinking of developing my own framework based on the
low-level API to take advantage of it's full power and flexibility. I
know what the pros are (power and flexibility), i'm asking are there
any cons? :) (besides, perhaps, longer developing time and effort on
my behalf)

Corneliu
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[google-appengine] Gmail implementation

2009-09-21 Thread Cornel

Hello guys!

I have a curiosity. From what i understand Gmail is implemented on the
same infrastructure that app-engine now offers to developers.

The email filters option in Gmail has the following options:
from:
to:
subject:
has the words:
doesn't have:
has attachment:

If i were to implement such a filter and assign it to a label i would
actually save a query with the upper information in a query object
associated with the user that owns this filter and run that query each
time he opens the label.

Since queries require indexes in order to work, and the user can
choose any combination of the above, that would mean a total of: C
(6,0) + C(6,1) + C(6,2) + C(6,3) + ... + C(6,6) = 2^6 = 64 indexes
needed to assure complete functionality (actually 63, because C(6,0)
is not required)

Is this how you implemented the filters feature ? (more or less) If
not, can you tell me how?
I would really like to know this because I'm developing an application
which features a company profiles' database, that should be filtered
and labeled by users, much the same way that Gmail does.

--~--~-~--~~~---~--~~
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-appengine@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
-~--~~~~--~~--~--~---



[appengine-java] App-engine + Google Calendar

2009-09-09 Thread Cornel

Hello!

I am trying to build an application in which a customer should be able
to put a reminder on a note, that he added to an entity within the
application (e.g. remind me to call this guy/company on Monday at
9:15 or note to myself: log in again at 16:00 to see it there have
been any changes in this article). That way the customer will be
notified (by e-mail, for example) at the precise moment.

I could use a cron job that periodically (every 5 minutes let's say)
searches though Reminder enitities in the datastore and sends e-
mails accordingly.

But it would be nicer if could integrate Google Calendar with app-
engine, thus not re-inventing the wheel. The problem i stumbled across
while doing this is the fact that i need the persons password to write
a new event in his calendar. Is there a way that he can grant
permission to the application to modify his calendar for this purpose?
--~--~-~--~~~---~--~~
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] App-engine + Google Docs

2009-09-09 Thread Cornel

Hello again!

I was thinking of implementing a feature in my application to export
portions of my application's database into a customer's google-docs
spreadsheet, so that he can make modifications on it, download it,
print it, etc.
Also i am interested in the reverse operation: the possibility to
import a spreadsheet into the datastore.

The problem that I'm facing is that i don't have access to a user's
documents without his password.
Isn't there a way for me to programatically request access to a
document (or to create a document on his behalf) and for him to
interactively grant me these rights (preferably only once, and then
remember the rights until he intentionally decides to revoke them)
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[google-appengine] Index appears as Serving but query return DatastoreNeedIndexException

2009-09-06 Thread Cornel

Hello!

My application id is cosinux68.
I've uploaded the following index definitions:

- kind: DbCustomer
  properties:
  - name: version
  - name: __key__

- kind: DbCustomer
  properties:
  - name: version
  - name: __key__
direction: desc

They appear as Serving but my queries return
DatastoreNeedIndexException. I'm sure they're the correct indices for
the query because they were also autogenerated in hosted mode. If i
try to vacuum them, i can't find them in the list! If i try to upload
them again nothing changes. So what can i do?


--~--~-~--~~~---~--~~
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-appengine@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
-~--~~~~--~~--~--~---



[google-appengine] Index building Error

2009-09-06 Thread Cornel

Hello!

The following index definition keeps giving Error. What are the
possible reasons for an index to be error prone?

   datastore-index kind=DbContact ancestor=false source=auto
property name=isCustomerProfile direction=asc/
property name=keyWords_S direction=asc/
property name=subcategory direction=asc/
property name=version direction=asc/
property name=__key__ direction=asc/
/datastore-index

Here is a part of the DbContact class:

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class DbContact extends DbEntity {

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

@Persistent
private String version
@Persistent
private ListString category;
@Persistent
private ListString subcategory;
@Persistent
private String isCustomerProfile;
@Persistent
private ListString keyWords_S;

I shoud mention the i also have an index similar to the one above, the
only difference being category, instead of subcategory, which was
created succesfully and is now Serving.
--~--~-~--~~~---~--~~
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-appengine@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
-~--~~~~--~~--~--~---



[appengine-java] JDO BUG !?

2009-09-04 Thread Cornel

Hello!

I have some objects in the database that have a String property called
version.
Some of them have version = '0.2', the others have '0.0'

I have an application written in java.
When i query for an object with version 0.2 with the low level api it
works (it finds 62 obejcts)

DatastoreService ds = 
DatastoreServiceFactory.getDatastoreService
();
Query q1 = new Query(DbRawContact);
q1.addFilter(version, FilterOperator.EQUAL, 0.2);
PreparedQuery pq = ds.prepare(q1);
log.info(remainging:  + pq.countEntities());

When i query with JDO the query doesn't fetch anything!

I won't post the JDO query here, because i actually use a wrapper
around it (too many lines to post here); but i'm 99.99% sure that code
is correct because it works for a version = '0.0' query with no
problems! (and for all other queries that i'm doing with it)

I even tried to fetch one of those version 0.2 objects using a
different property; was succesful, so then i tried a consecutive query
with version = fetchedObject.getVersion(). No results! What gives? :(
--~--~-~--~~~---~--~~
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 make a query using low level API using the 'key' property?

2009-09-04 Thread Cornel

Hello,

How can i make a Query using the lowlevel API, similar to this:
select * from Entity where key  certain_key ?

In JDO i would do something like this:
select * from Entity where encodedKey  a_key_string

where encodedKey is my objects' primary key:

@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
@Extension(vendorName=datanucleus, key=gae.encoded-pk,
value=true)
private String encodedKey;
--~--~-~--~~~---~--~~
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 make a isKeysOnly() query in JDO?

2009-09-03 Thread Cornel

Hello!

I've read that a keys only query is much faster than a normal query,
so I want to use this for pagination. But the setKeysOnly() is only
applicable to com.google.appengine.api.datastore.Query, not also
javax.jdo.Query.

I've been using JDO so far, so is there a way to tell JDO you're
asking only for keys?

I'm trying to do pagination, so at a given moment i will have to skip
through entitites, beyond the well known 1000 limit. So i was thinking
of making conscutive (key only!) queries of (max) 1000 entities, with
the filter: key  key of last element fetched by the previous query.
When i reach the the entities i need to display i will call
pm.getObjectsById() on the last set of keys.

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



[google-appengine] Indexes stuck in 'Building' state. Cannot vacuum ('because they no longer exist')

2009-09-03 Thread Cornel

Hello!


I have two index stuck in 'Building' state, for the past 12 hours. I
still have entities in the datastore, but they should have finished
building by now. I can't vacuum them with appcfy.py because it says
they are no longer there. I see the 'trend' is to ask one of guys to
help me out vacuum the indexes (my application id is 'cosinux68'). But
why don't you implement a force clear indexes' feature? :)

Thank you,
Cornel
--~--~-~--~~~---~--~~
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-appengine@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
-~--~~~~--~~--~--~---



[appengine-java] Inconsistence between how app-engine sorts string encoded-keys and java method String.compareTo()

2009-09-01 Thread Cornel

Hello!

I ran over this problem. I was retrieving a DbContact data set
simply ordered by
encodedKey ascending, and i got this list:

[(key agljb3NpbnV4NjhyIQsSCkRiQ3VzdG9tZXIYm0gMCxIJRGJDb250YWN0GJxIDA
name EUROTRIM)
, (key agljb3NpbnV4NjhyIQsSCkRiQ3VzdG9tZXIYnUgMCxIJRGJDb250YWN0GJ5IDA
name ANCA ELECTRIC SYSTEMS)
, (key agljb3NpbnV4NjhyIQsSCkRiQ3VzdG9tZXIYn0gMCxIJRGJDb250YWN0GKBIDA
name TWIN TRADING)
...

So, apparently
agljb3NpbnV4NjhyIQsSCkRiQ3VzdG9tZXIYnUgMCxIJRGJDb250YWN0GJ5IDA 
agljb3NpbnV4NjhyIQsSCkRiQ3VzdG9tZXIYn0gMCxIJRGJDb250YWN0GKBIDA (the
second and the third entries in the above list)

But
agljb3NpbnV4NjhyIQsSCkRiQ3VzdG9tZXIYnUgMCxIJRGJDb250YWN0GJ5IDA.compareTo
(agljb3NpbnV4NjhyIQsSCkRiQ3VzdG9tZXIYn0gMCxIJRGJDb250YWN0GKBIDA) =
37  0, which is opposite!

The encodedKey field is defined in the DbContact class as:

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class DbContact extends DbEntity {

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

@Persistent
private DbCustomer customer;
...

Also, i have a DbCustomer class which is the parent of a DbContact
class, defined as:

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class DbCustomer extends DbEntity {

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

@Persistent(mappedBy = customer)
@Order(extensions = @Extension(vendorName=datanucleus,
key=list-ordering, value=customerProfile desc))
private ListDbContact contacts;
..

So what's with this inconsistence? Have 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
-~--~~~~--~~--~--~---



[google-appengine] CPU Quota

2009-09-01 Thread Cornel

Hello!

I tried to upload my database from a *.csv file using the appcfg.py
tool. The file has about 35MB.

The first time i uploaded (several weeks ago) it consumed about 70%
CPU Quota.
Later i deleted the database.

Today i tried to upload again, but the quota got 95% and it only
uploaded about half of the database. (I also got a lot of HTTPError:
HTTP Error 403: Forbidden errors).

My question is, where does the difference in CPU Quota come from
(considering it was the same script and the same input file) ?
--~--~-~--~~~---~--~~
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-appengine@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
-~--~~~~--~~--~--~---



[google-appengine] Inconsistence between how app-engine sorts string encoded-keys and java method String.compareTo()

2009-09-01 Thread Cornel

Hello!

I ran over this problem. I was retrieving a data set ordered by
encodekey ascending:

[(key agljb3NpbnV4NjhyIQsSCkRiQ3VzdG9tZXIYm0gMCxIJRGJDb250YWN0GJxIDA
name EUROTRIM)
, (key agljb3NpbnV4NjhyIQsSCkRiQ3VzdG9tZXIYnUgMCxIJRGJDb250YWN0GJ5IDA
name ANCA ELECTRIC SYSTEMS)
, (key agljb3NpbnV4NjhyIQsSCkRiQ3VzdG9tZXIYn0gMCxIJRGJDb250YWN0GKBIDA
name TWIN TRADING)
...

So agljb3NpbnV4NjhyIQsSCkRiQ3VzdG9tZXIYnUgMCxIJRGJDb250YWN0GJ5IDA 
agljb3NpbnV4NjhyIQsSCkRiQ3VzdG9tZXIYn0gMCxIJRGJDb250YWN0GKBIDA

But
agljb3NpbnV4NjhyIQsSCkRiQ3VzdG9tZXIYnUgMCxIJRGJDb250YWN0GJ5IDA.compareTo
(agljb3NpbnV4NjhyIQsSCkRiQ3VzdG9tZXIYn0gMCxIJRGJDb250YWN0GKBIDA) =
37  0

The encodedKey is defined as:

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class DbContact extends DbEntity {

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

@Persistent
private DbCustomer customer;
...

Also:

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class DbCustomer extends DbEntity {

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

@Persistent(mappedBy = customer)
@Order(extensions = @Extension(vendorName=datanucleus, key=list-
ordering, value=customerProfile desc))
private ListDbContact contacts;
--~--~-~--~~~---~--~~
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-appengine@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
-~--~~~~--~~--~--~---



[appengine-java] Unicode to ASCII equivalence (java.text.Normalizer not supported by app-engine VM)

2009-08-25 Thread Cornel

Hello!

I need to save unicode strings and also create a ascii version of
them (to make a keyword list for searching purposes) such as:
Animale, cu excepţia peştelui = [ANIMALE, EXCEPTIA, PESTELUI]

For that i need the following conversions: ţ - t, ş - s and so on.
My first approach was the following:

orig = Normalizer.normalize(field, Form.NFKD).toCharArray();
ascii = new byte[orig.length];
count = 0;
for (int i = 0; i  orig.length; i++) {
if (orig[i]  128) {
ascii[count++] = (byte) orig[i];
}
}
try {
field = new String(ascii, UTF-8);
}
catch (UnsupportedEncodingException e) {
e.printStackTrace();
}

This works very well in java generally, but when i tried it in an app-
engine project i got a compiler error:

java.text.Normalizer.Form is not supported by Google App Engine's
Java runtime environment

What workaround do you suggest?

Thank you,
Cornel
--~--~-~--~~~---~--~~
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
-~--~~~~--~~--~--~---



[google-appengine] Transactions

2009-08-07 Thread Cornel

Hello. I'm using app engine to write a business application. I've read
that during a transaction one can modify only entities within the same
entity group. How would one approach the following scenario? :

Consider the Account object with the Owner and Credit fields.

If i want to make a credit transfer between accounts A and B
(A.credit--; B.credit++), it must be done in a single transaction.
That can only happen if A and B are in the same entity group (from
what i understand)

Since a credit transfer can be done between any two random accounts, i
must put them all in the same entity group; but this way, two
unrelated transfers (A to B and C to D let's say) cannot be done at
the same time anymore. Which again is not desired (i understand that
having a single big entity group is bad practice)

I think this is a pretty general problem (not related only to this
scenario), so how is it solved?

--~--~-~--~~~---~--~~
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-appengine@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
-~--~~~~--~~--~--~---



[google-appengine] Transactions cross entity groups

2009-08-07 Thread Cornel

(I've posted this message one day ago but it did not appear on the
group discussion list, so i will post it again. Hope i am not spamming
or anything)


Hello. I'm using app engine to write a business application. I've read
that during a transaction one can modify only entities within the same
entity group. How would one approach the following scenario? :

Consider the Account object with the Owner and Credit fields.

If i want to make a credit transfer between accounts A and B
(A.credit--; B.credit++), it must be done in a single transaction.
That can only happen if A and B are in the same entity group (from
what i understand)

Since a credit transfer can be done between any two random accounts, i
must put them all in the same entity group; but this way, two
unrelated transfers (A to B and C to D let's say) cannot be done at
the same time anymore. Which again is not desired (i understand that
having a single big entity group is bad practice)

I think this is a pretty general problem (not related only to this
scenario), so how is it solved?

--~--~-~--~~~---~--~~
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-appengine@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
-~--~~~~--~~--~--~---



[google-appengine] Query with numeric comparison

2009-08-07 Thread Cornel

How can i make a query like this  ... where field  number ?
Lexically 55  6, and that's what i think the query will return,
but it is not what i want. So how can i save the number field (as a
string) such that it will behave equivalent to the numeric comparison.

--~--~-~--~~~---~--~~
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-appengine@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
-~--~~~~--~~--~--~---