[appengine-java] Filter on float value in JDO query

2010-04-08 Thread Bert
Hi,

I'm trying to execute following query, which should return 3 values
but returns 0.
I think it's because pointsEarned is a float, but I don't know how to
solve it.

Query query = pm.newQuery(Answer.class);
query.setFilter("pointsEarned < 0");
List answers = (List) query.execute();

There are 3 Answer entities in the datastore with pointsEarned = -1.0

Is there anyway to query like this < on a float field?

Regards

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-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] Disable send copy of e-mail to Admin account

2010-04-17 Thread Bert
If I send a mail to a user, a copy gets mailed to the admin e-mail
address as well,
I guess this is normal but is there any way to turn this off?

I can add recipients, but seem to be unable to remove recipients.

Regards

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-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] Code does not run server side.

2009-12-25 Thread Bert Peters
Some code, that i created and tested using Eclipse and the google
plugin, seems not to run while installed on the App Engine, no matter
what.
I have really no idea what it couldd be, Anyone else an idea?

By the way, the code for all files is listed below.

Main file:

package poaphost;

import javax.servlet.http.*;
import javax.jdo.Query;
import javax.jdo.PersistenceManager;
import java.io.IOException;
import poaphost.PMF;
import poaphost.Address;
import poaphost.Iphandler;

import java.util.Locale;
import java.util.Random;
import java.util.List;
import java.util.Date;
import java.util.Formatter;

public class LOGONServlet extends HttpServlet {

/**
 *
 */
private static final long serialVersionUID = 1373256072813419920L;

public void doGet(HttpServletRequest req, HttpServletResponse resp)
throws IOException {
String uid = "";
Cookie[] cookies = req.getCookies();
for (Integer i = 0; i < cookies.length; i++) {
if (cookies[i].getName().equals("poap_uid")
&& cookies[i].getValue().length() == 8) 
{
uid = cookies[i].getValue();
}
}
if (uid == "") {
String base = "abcdefghijklmnopqrstuvwxyz1234567890";
Random generator = new Random();
for (Integer i = 0; i < 8; i++) {
uid += base.charAt(generator.nextInt(35));
}
}

String ip = req.getRemoteAddr();

Long ipNo = Iphandler.ip2long(ip);

PersistenceManager pm = PMF.get().getPersistenceManager();

Query q = pm.newQuery(Address.class, "ip == ipParam && code ==
uidParam");
q.declareParameters("Long ipParam, String uidParam");

List result = (List) q.execute(ipNo, uid);

if (result.isEmpty()) {
Address a = new Address(ipNo, uid);
pm.makePersistent(a);
}
Cookie c = new Cookie("poap_uid",uid);
c.setPath("/");
c.setDomain("http://poaphost.appspot.com";);
c.setMaxAge(60*60*24*365);

resp.setContentType("text/xml");
resp.setCharacterEncoding("ISO-8859-1");
resp.addCookie(c);

Date d = new Date();

Long i = d.getTime();

Double f = i.doubleValue() / 1000;

StringBuilder sb = new StringBuilder();

Formatter formatter = new Formatter(sb, Locale.US);
formatter.format("%11.4f", f);

resp.getWriter().println(
"");
resp.getWriter().println("");
resp.getWriter().println("logon");
resp.getWriter().println("1");
resp.getWriter().println("0");
resp.getWriter().println("" + sb.toString() + "");
resp.getWriter().println("0");
resp.getWriter().println("" + uid + "");
resp.getWriter().println("");
}

}

poaphost.PMF file

package guestbook;

import javax.jdo.JDOHelper;
import javax.jdo.PersistenceManagerFactory;

public final class PMF {
private static final PersistenceManagerFactory pmfInstance =
JDOHelper.getPersistenceManagerFactory("transactions-
optional");

private PMF() {}

public static PersistenceManagerFactory get() {
return pmfInstance;
}
}
 file poaphost.iphandler

package poaphost;

public class Iphandler {
public static long ip2long( String aIpAddress )
{
long ip = 0;
String[] t = aIpAddress.split("\\.");
ip = Long.parseLong(t[0]) * 256 * 256 * 256;
ip += Long.parseLong(t[1]) * 256 * 256;
ip += Long.parseLong(t[2]) * 256;
ip += Long.parseLong(t[3]);
return ip;
}
public static String long2ip( long aIpAddress )
{
return (aIpAddress >> 24 & 255) + "." + (aIpAddress >> 16 &
255) + "." + (aIpAddress >> 8 & 255) + "." + (aIpAddress & 255);
}
}

file poaphost.Address

package poaphost;

import com.google.appengine.api.datastore.Key;

import java.lang.Long;
import java.lang.String;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.IdentityType;
import javax.jdo.annotations.PersistenceCapable;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

@PersistenceCapable(identityType = IdentityType.APPLICATION)
public class Address {
@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Key key;

@Persistent
private Long ip;

@Persistent
private String code;

public Address(Long ip, String code) {
   

[appengine-java] Re: Spring Security with GAE - Adding object into HttpServletRequest does not appear to be working

2009-12-26 Thread Bert Peters
What you could do, is check the logs, in your admin panel. They show
which error is generated, and at which line. I had a similar problem
once, and that helped.

On Dec 24, 9:46 pm, "sulaimanmra...@googlemail.com"
 wrote:
> Hi,
>
> I've created a GAE web application using Spring 3.0 and Spring
> Security 2.0.5.
>
> After a little heartache and help from reading the posts on the forum,
> I managed to get it all working locally, with users able to register,
> validate their accounts via email and login in securely.
>
> When a user logs in, I wanted to make their details available across
> the site. I did this by creating an Interceptor, responsible for
> pulling the prinicipal from the Spring Security Authentication class
> (retrieved from the SecurityContextHolder) and then placing the object
> in the HttpServletRequest object. Below is a snippet of code from the
> interceptor.
>
>      public void postHandle(
>                         HttpServletRequest request,
>                         HttpServletResponse response,
>                         Object handler,
>                         ModelAndView modelAndView) {
>
>                 try {
>                         Member member = securityContext.getMember();
>                         request.setAttribute("user", member);
>
>                         log.info("injecting user into request");
>
>                 } catch(SecurityRuntimeException e) {
>                         // do nothing - will be thrown if no user is logged in
>                 }
>         }
>
> The user's information is wrapped in a 'Member' object, with the
> securityContext responsible for retrieving it from the
> SecurityContextHolder.
>
> Locally, on the GAE development environment, everything works fine!
> The interceptor correctly places the principal in the request and my
> JSP's can readily access it. However, when I deploy the application to
> the app engine, it does not appear to work. The logs have not provided
> any clue as to why the request does not appear to have the principal
> in it.
>
> Is there any reason why the interceptor would not work on the app
> engine? Or, is it ill-advised to add objects into the
> HttpServletRequest?
>
> I'm tearing my hair out with why it's not working, and it's the only
> thing within my application that isn't! So any help or advice offered
> is much appreciated. I'm hoping to have my code up in the Google Code
> repository so if anyone wants to have a look, they're more than
> welcome.
>
> Thanks!
> Sully

--

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: Eclipse AppEngine Plugin

2009-12-26 Thread Bert Peters
Yes, it certainly could. For every version of eclipse, there is a
specific update of the Google Plugin you need. For Galileo, you nee
this: http://dl.google.com/eclipse/plugin/3.5
Make sure you've got that one, instead of the 3.4 one or something.

On Dec 24, 10:40 am, Ambiency  wrote:
> I have recently  upgraded eclipse to Galileo. Previously, with
> Ganymede, I had no problems running an app locally using the Google
> Appengine plugin. I now cannot run Appengine code (run as ...Google
> Web App). I get an exception
> 'javax.xml.parsers.FactoryConfigurationError: Provider
> oracle.xml.jaxp.JXDocumentBuilderFactory not found'
>
> I have now also tried running my Ganymede installation and that falls
> over during a build with the same message.
>
> Could this be related to the Eclipse upgrade?
>
> Regards
>
> Kevin

--

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: First Request High CPU

2010-01-11 Thread Bert Peters
I believe that, in normal situations, App Engine shuts down your
application if it has not had any request for the last 10 minutes. You
could set your cron to run it every five, and it should be good. I
however do not understand how your (Ikai) cron could take up so much
CPU use. I'd profile that.

On Jan 11, 4:58 am, Shrek  wrote:
> hi Ikai
>
> does appengine suffer from this anomaly even when "billing" is
> enabled?
> my application doesn't receive much traffic, but i still need it to be
> "ready".
> I don't mind enabling "billing" and don't even mind any $ value (as a
> consequence), but I would like to know if the problem will go away...
>
> Does anybody else know the answer for this question?
>
> Thanks
>
> On Nov 30 2009, 11:38 am, "Ikai L (Google)"  wrote:> Yes. 
> This is an issue we are working on. Basically, what happens is that
> > instances of your application are elastic and loaded up upon demand. As your
> > application grows, we will grow with you, but one of the consequences of
> > this is that if your application is not receiving many requests, we may
> > cycle you out to allocate more instances for an application with higher
> > resource requirements.
>
> > We discourage running cron jobs to reduce startup time because ultimately,
> > this will result in more aggressive cycling for all of our users. We're
> > looking at several techniques to speed up Java application startup time.
> > It's also been suggested that we should look at a billing enabled option for
> > keeping a certain number of instances warm at all times.
>
> > On Sun, Nov 29, 2009 at 11:22 PM, Jeffrey Goetsch 
> > wrote:
>
> > > I have noticed that the first request to a server instance has really high
> > > CPU usage (7000+ milliseconds).  After the server is up, the same request
> > > takes only 20 milliseconds.  I am not using Spring or any other framework.
> > >  It appears that the time is used during the first execute call on a
> > > Datastore query.
>
> > > Is this a normal behavior?
>
> > > I have a cron job that I was running every 2 minutes, but that alone was
> > > using 15% of my free quota.  I have moved the cron to every minute, and 
> > > I'm
> > > seeing huge improvement on performance and quota.  The cron used to take
> > > 7000+ ms  and now I am getting 20ms.  Does this mean you should make sure
> > > you have at least on cron running every minute?
>
> > > Thanks,
> > > Jeffrey
>
> > > --
> > > 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 > >  unsubscr...@googlegroups.com>
> > > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/google-appengine-java?hl=en.
>
> > --
> > Ikai Lan
> > Developer Programs Engineer, Google App Engine
-- 
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: Beginner question: one to many relationship

2010-01-11 Thread Bert Peters
If your database has been normalized, I'd say you need something these
2 queries:
"SELECT FROM author.id WHERE author.name = nameParam, PARAMETER string
nameParam"
"SELECT FROM books WHERE book.author = idParam, PARAMETERS Key
idParam"

Or something like that. HTH.

On Jan 10, 11:40 pm, fhucho  wrote:
> Hi, sorry for beginner question. I have authors and books in the
> database. Every author has list of books in a one to many owned
> relationship. I know the author's name, how can I retrieve the author
> and his books from database? I know how to get the author but not his
> books (Author.books).
-- 
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] Can an Integer be a primary key for JDO?

2010-01-16 Thread Bert Peters
I was just wondering whether I could use an Integer for a primary key
in JDO, as it would be a great convenience in my application.
I couldn't really find an answer to this in the documentation, so I
ask you. Can I?
-- 
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: Can an Integer be a primary key for JDO?

2010-01-16 Thread Bert Peters
Thank you for that information, but that's not what i meant.
What i did mean is whether this is correct/possible:

@PrimaryKey
@Persistent(idGeneratorStrategy=INCREMENT)
private Integer id;

On Jan 16, 2:25 pm, jd  wrote:
> Keys can either have a system generated long "id" (not set by you) or
> a String "name".
>
> There used to be no way to create an Entity with a long - but now (as
> of 1.2.7?) there is a constructor Entity(Key) and you can create a key
> with a long.  But the docs say:
>
> "Creating an entity for the purpose of insertion (as opposed to
> update) with a key that has its id field set is strongly discouraged
> unless the key was returned by a KeyRange."
>
> So basically the answer is still no.
>
> Twig gets around this by converting whatever field you declare as a
> @Key into a String and back again - even Integers.
>
> On Jan 16, 7:02 pm, Bert Peters  wrote:
>
> > I was just wondering whether I could use an Integer for a primary key
> > in JDO, as it would be a great convenience in my application.
> > I couldn't really find an answer to this in the documentation, so I
> > ask you. Can I?
-- 
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: Can an Integer be a primary key for JDO?

2010-01-17 Thread Bert Peters
Thank you. This was the information I needed. Data reduction was no
goal, i just needed a numeric key.

On Jan 16, 10:03 pm, Jeff Schnitzer  wrote:
> I don't know what JDO will do, but I can tell you that this won't help
> you reduce data storage requirements, if that is your goal.
>
> Some things to know about the Low-Level API, and thus any layer on top
> (JDO, JPA, Objectify, Twig, whatever):
>
>  * Numeric keys will be persisted as a Long (or String).
>
>  * All numeric property values get persisted as a Long (even if they
> get converted back to something smaller by the library).
>
> JeffOn Sat, Jan 16, 2010 at 5:59 AM, Bert Peters  
> wrote:
> > Thank you for that information, but that's not what i meant.
> > What i did mean is whether this is correct/possible:
>
> > @PrimaryKey
> > @Persistent(idGeneratorStrategy=INCREMENT)
> > private Integer id;
>
> > On Jan 16, 2:25 pm, jd  wrote:
> >> Keys can either have a system generated long "id" (not set by you) or
> >> a String "name".
>
> >> There used to be no way to create an Entity with a long - but now (as
> >> of 1.2.7?) there is a constructor Entity(Key) and you can create a key
> >> with a long.  But the docs say:
>
> >> "Creating an entity for the purpose of insertion (as opposed to
> >> update) with a key that has its id field set is strongly discouraged
> >> unless the key was returned by a KeyRange."
>
> >> So basically the answer is still no.
>
> >> Twig gets around this by converting whatever field you declare as a
> >> @Key into a String and back again - even Integers.
>
> >> On Jan 16, 7:02 pm, Bert Peters  wrote:
>
> >> > I was just wondering whether I could use an Integer for a primary key
> >> > in JDO, as it would be a great convenience in my application.
> >> > I couldn't really find an answer to this in the documentation, so I
> >> > ask you. Can I?
>
> > --
> > 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 
> > 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-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 doesn't save every modification

2010-01-19 Thread Bert Peters
I have a problem with testing my app. A class, handled by some other
class, saves only partial updates. Why is this, and what could I do to
prevent it?

The object that is not converted is a serialized List.
-- 
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: JDO doesn't save every modification

2010-01-19 Thread Bert Peters
Alright, here we go.
Somewhere in execution, 2 dates, 4 double fields and an integer list
are updated to new values. During checkup in the rest of the program,
everything seems OK.
Then, upon finish, at pm.close(), all updated variables are saved,
except for the integer list. Enough information?

On Jan 19, 2:22 pm, John Patterson  wrote:
> On 19 Jan 2010, at 19:43, Bert Peters wrote:
>
> > A class, handled by some other
> > class, saves only partial updates.
>
> I think you'll need to give a bit more context.
-- 
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: JDO doesn't save every modification

2010-01-19 Thread Bert Peters
stone;
}

public void setFood(double food) {
this.food = food;
}

public double getFood() {
return food;
}

public void setCrystals(double crystals) {
this.crystal = crystals;
}

public double getCrystals() {
return crystal;
}

public void setBuildings(Integer i, Integer l) {
this.buildings.set(i, l);
}

public Integer getBuildings(Integer i) {
return buildings.get(i);
}

public void setWood(double wood) {
this.wood = wood;
}

public double getWood() {
return wood;
}

public void setLastResourceUpdate(Date lastResourceUpdate) {
this.lastResourceUpdate = new Date();
}

public Date getLastResourceUpdate() {
return lastResourceUpdate;
}

public void setLocation(Integer location) {
this.location = location;
}

public void setLocation(Integer[] location) {
this.location = 2 * location[0] + 400 * location[1] + 
location
[2];
}

public Integer getLocation() {
return location;
}

public Integer[] getLocationArray() {
Integer[] o = new Integer[3];
o[0] = this.location / 2;
o[1] = (this.location % 2) / 400;
o[2] = (this.location % 2) % 400;
return o;
}

public String getLocationDisplay() {
String o = "";
Integer[] l = this.getLocationArray();
o = (l[0] + 1) + ":" + (l[1] + 1) + ":" + (l[2]+1);
return o;
}

public void setServer(Integer server) {
this.server = server;
}

public Integer getServer() {
return server;
}
public void doResourceUpdate() {
Long lastUpdate = this.lastResourceUpdate.getTime();
Long current = java.lang.System.currentTimeMillis();
Long elapsed = (current - lastUpdate);
// Don't update more than once every five seconds
if(elapsed < 5000) return;
Double t = elapsed.doubleValue();
double partialHour = t / (60*60*1000);
double partialDay = partialHour / 24;
// Daily decay of food
this.food = this.food * Math.pow(0.9,partialDay);
// Stone
Double stoneMine = (double) this.buildings.get(0);
this.stone += partialHour*(20 + 20*(Math.pow(1.3, stoneMine) - 
1));
// Wood
Double lumberCamp = (double) this.buildings.get(1);
this.wood += partialHour*(10+ 20*(Math.pow(1.2, lumberCamp) - 
1));
// Food
Double farm = (double) this.buildings.get(2);
this.food += 15*(Math.pow(1.2, farm)-1) * partialHour;

this.setLastResourceUpdate(new Date());
}

public void setCurrentBuildDone(Date currentBuildDone) {
this.currentBuildDone = currentBuildDone;
}

public Date getCurrentBuildDone() {
return currentBuildDone;
}

public void setCurrentBuild(Integer currentBuild) {
this.currentBuild = currentBuild;
    }

public Integer getCurrentBuild() {
return currentBuild;
}

}
List buildings is not saved, the rest is.

On Jan 19, 5:09 pm, Raphael André Bauer
 wrote:
> On Tue, Jan 19, 2010 at 4:55 PM, Bert Peters  wrote:
> > Alright, here we go.
> > Somewhere in execution, 2 dates, 4 double fields and an integer list
> > are updated to new values. During checkup in the rest of the program,
> > everything seems OK.
> > Then, upon finish, at pm.close(), all updated variables are saved,
> > except for the integer list. Enough information?
>
> Not really.. source code is always better...
>
> Did you already look into default fetch groups?
> (@Persistent(defaultFetchGroup = "true").
>
> I guess your list is simply not fetched by default and your integer
> list is null...
>
> Raphael
>
>
>
> > On Jan 19, 2:22 pm, John Patterson  wrote:
> >> On 19 Jan 2010, at 19:43, Bert Peters wrote:
>
> >> > A class, handled by some other
> >> > class, saves only partial updates.
>
> >> I think you'll need to give a bit more context.
>
> > --
> > 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] Re: JDO doesn't save every modification

2010-01-19 Thread Bert Peters
Ok, here is the rest. Sorry about the bad problem definition:

Basically, it's like this.

(cp.base is an instance of the before mentioned Base class)
Integer cb = this.base.getCurrentBuild();
cp.base.setBuildings(cb , 
this.base.getBuildings(cb) + 1);
cp.base.setCurrentBuild(null);

On Jan 19, 8:02 pm, datanucleus  wrote:
> Define "updates" with respect to that field. Saying you change
> something is one thing, but posting the code that changes that thing
> is a prerequisite to any comment. Obviously the log would also tell
> you plenty about that field, like is it replaced by a proxy/wrapper
> when it is read in ?
-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-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: JDO doesn't save every modification

2010-01-19 Thread Bert Peters
The type returned is "class java.util.ArrayList". Is there a possible
way to fix this?

On Jan 19, 8:30 pm, datanucleus  wrote:
> Look in the log (at DEBUG level) and see if the List field is replaced
> by a wrapper type when you retrieve the overall object from the
> datastore. Alternatively, print out the getClass() of the List object
> before your update.
>
> If it isn't of type "org.datanucleus.sco." then the error is in
> GAE/J not replacing the field with a wrapper before handing it back to
> the user (and issue was raised on it some time ago for that). 
> Seehttp://code.google.com/p/datanucleus-appengine/issues/detail?id=144&c...
> if that is your case
-- 
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: Forcing update of JPA entity

2010-01-21 Thread Bert Peters
JDO does not do this too. I think it is a rather annoying bug.
Serializing does not work (use that too myself) and just modifing an
element does not work too, as your program clearly found out. Still
waiting for a fix though...

On Jan 22, 12:50 am, Elias Mårtenson  wrote:
> On 22 Jan, 00:26, datanucleus  wrote:
>
> > Shouldn't make the slightest bit of difference. GAE/J ought to replace
> > that List with a wrapper that intercepts update operations. It hasn't
> > done 
> > that.http://code.google.com/p/datanucleus-appengine/issues/detail?id=144&c...
>
> Thanks for the information. I didn't know about this.
>
> However, even if this issue was fixed it wouldn't apply for two
> reasons:
>
> 1) I'm not using relationships to store this list. It's actually
> serialised as a @Basic member.
>
> 2) I'm not actually modifying the list. I'm modifying an element
> inside the list.
>
> Your workarund, to use JDOHelper would be what I need, but I'm not
> using JDO. I'm using JPA. Is there a similar workaround there?
>
> Elias

-- 
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: generating sequential ids

2010-01-23 Thread Bert Peters
What you could do is something like this:
public class Employee {
@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.INCREMENT)
private Long id;

@Persistent private String department;
@Persistent private String firstName;
@Persistent private String lastName;

}
start with id 1, and goes on untill they have reached 2^32 - 1.
Should do the trick.

On Jan 23, 7:25 am, aswath satrasala 
wrote:
> Hi,
> I have an Employee class
> public class Employee {
>     @PrimaryKey
>     @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
>     @Extension(vendorName="datanucleus", key="gae.encoded-pk", value="true")
>     private String id;
>
>     @Persistent private String department;
>     @Persistent private String firstName;
>     @Persistent private String lastName;
>
> }
>
> Now, I want to provide a EmployeeID to the employee.  I will not be able to
> provide gae.encoded-pk value as this is long and not meaningful.
> Further, I want to provide the EmployeeID with department as the prefix.
> How can I generate the EmployeeID, similar to sequence in the relational
> world.
>
> -Aswath

-- 
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: Development Server on Windows 7 continues to run after CTRL-C

2010-02-27 Thread Bert Peters
Did you press CTRL+C inside the cmd prompt window?

On 26 feb, 23:04, brianl  wrote:
> Running the development server on Windows 7 64-bit.  After CTRL-C of
> the development server still seeing the Java process running in the
> task manager.  Have to kill the process from the task manager before
> relaunching the development server.  Using JDK1.6 32-bit.

-- 
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: createLoginURL() and Sing-up behavior when running locally under Eclipse debugger?

2010-02-27 Thread Bert Peters
If you read on on that page, you'll see that:
QUOTE:
"The development server knows how to simulate the Google Accounts sign-
in facility. When run on your local machine, the redirect goes to the
page where you can enter ANY email address to simulate an account sign-
in."

This explains your problem, I believe.

On 26 feb, 19:48, Mike  wrote:
> Hi,
>
> In following along with the example/tutorial 
> from:http://code.google.com/appengine/docs/java/gettingstarted/usingusers
>
> The page states that calls to:
> com.google.appengine.api.users.UserService.createLoginURL()
>
> with an email/username that does not have a google account (even when
> running under Eclipse) will redirect to what appears to be a Google
> Accounts sign-up page.
>
> However, I am unable to trigger that behavior, no matter what text I
> provide to that control.
>
> Any suggestions?  Is this a bug or a misprint (or even, a
> misunderstanding on my part)?
>
> Cheers
> Mike Sheridan

-- 
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] Discussion on will-it-play-in-app-engine

2010-07-05 Thread Bert Peters
I succesfully tested FreeMarker (www.freemarker.org) on App Engine.
Care to add it to the list?

-- 
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] Datastore questions

2010-07-05 Thread Bert Peters
A while ago there was a problem with arrays and lists, once persisted,
not getting updated properly after a change of a certain value. I have
two questions on that matter.
1. Does that still occur?
2. Does this bug affect (Hash)Maps as well?

Kind regards, Bert Peters.

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