[appengine-java] Re: Moderation enabled

2009-11-25 Thread Sumit
Hey Jason,
 Will it take longer for me to be verified?

Thanks,
Sumit

On Sep 29, 7:55 am, "Jason (Google)"  wrote:
> Due to the recent uptick in spam messages, I have enabled moderation
> for new members -- this means that if you haven't posted here before,
> your message may not show up right away until I have the opportunity
> to approve it.
>
> Please do not double-post -- if you don't see your message right away,
> please wait up to 24 hours for it to be posted. Once your first post
> is up, all other posts should appear immediately.
>
> Thanks,
> - Jason

--

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: Persisting java.util.TimeZone

2009-11-25 Thread aldrinm
Thanks Jason,

Marking it as serialized works!
...
@Persistent(serialized = "true")
TimeZone timeZone


Cheers,
Aldrin


On Oct 20, 11:11 pm, "Jason (Google)"  wrote:
> Have you tried storing it as a serialized 
> property?http://gae-java-persistence.blogspot.com/2009/10/serialized-fields.html
>
> If so, then please post your implementation that doesn't work and any log
> details re: the failure.
>
> - Jason
>
>
>
> On Fri, Oct 16, 2009 at 7:07 AM, aldrinm  wrote:
>
> > Hi,
>
> > Can I persist an instance of java.util.TimeZone in the datastore? From
> > this thread,
> >http://groups.google.com/group/google-appengine-java/browse_thread/th...
> > and the whitelist
> >http://code.google.com/appengine/docs/java/jrewhitelist.html
> > , it appears that it can be done. Unable to get it to work. Any
> > pointers?
>
> > Thanks
> > Aldrin

--

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] (JDOQL) Is this a bug? (repost)

2009-11-25 Thread Prashant
following is my JDO class:

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

@Persistent(primaryKey = "true")
private String EmailID;

@Persistent
private String Name;

@Persistent
private List Groups;
}



following is my test case:


PersistenceManager pm = pmf.getPersistenceManager();

Query query = pm.newQuery(_Contact.class);

query.setOrdering("EmailID");
query.setFilter("Groups.contains(\"mygroup\")");

int i = 1;
for(_Contact cont : (List<_Contact>) query.execute()){
resp.getWriter().print(i++ + " " + cont.getID() + "");
}

pm.close();


above code printed 23 contacts and when I replaced  *
query.setOrdering("EmailID"); *by *query.setOrdering("EmailID desc"); *it
printed 18 contacts only. Is it a bug or I am missing something?

--

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




Re: [appengine-java] Re: JDO preview release : child object is still null !

2009-11-25 Thread Prashant
Is there any plan to support polymorphism in relationships? I tried it with
1.2.8 pre-release, felt disappointed seeing it is not supported yet. I was
expecting it to be supported in 1.2.8 release.

--

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] XMPP Message not being received

2009-11-25 Thread Ravi Sharma
Hi,
I am trying to write a XMPP Client. When i send a mesage from Client to GAE
application, it always reach the server and then server reply back. When i
ran the client first time it worked for 3-4 times. but then now i am not
receiving any message on client side. I checked the server logs and it says
that Message sent succesfully.

I am using my gmail id on client side to connect to
talk.google.comserver.And i logged out my self from all google client
like gmail, gtalk
etc, as i was thinking may be message is being sent to another client.
Intrestingky when i am logged in to Gtalk at the time when i am running my
client, Gtalk recive the response from server. I am using smack libraries
forXMPP client.

1) Can you please suggest what can be a problem here.
2) Is XMPP communication is 100% delivery system. Is there chance that my
message will get lost once on server or client i see that message has been
sent.



Thanks,
Ravi.

--

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: Spring Web Flow

2009-11-25 Thread Dieter Hubau
Looks like someone has a similar problem, yet he gave better detailed
information:

http://forum.springsource.org/showpost.php?p=270885&postcount=3

If anyone can help, respond in any of the two threads please!

On 18 nov, 17:37, Dieter Hubau  wrote:
> Indeed, I have created a similar thread over there:
>
> http://forum.springsource.org/showthread.php?t=80572
>
> If anyone has any clue what could have been wrong, or wants to help me
> and wants to see some of the code, let me know!
>
> On Nov 13, 10:08 pm, Rusty Wright  wrote:
>
>
>
> > Have you tried the Spring forums?  Perhaps your problem is specific to 
> > Spring Web Flow and not App Engine.  http://forum.springsource.org/
>
> > DieterHubauwrote:
> > > I hope some people who know stuff about Spring Web Flow are reading
> > > this :-)
>
> > > On Nov 12, 3:48 pm,DieterHubau wrote:
> > >> Anyone? If you need extra information, I'm willing to paste more of
> > >> the code here..
>
> > >> On Nov 12, 10:29 am,DieterHubau wrote:
>
> > >>> Hi everyone,
> > >>> I m having an error using Spring + Spring Web Flow in my java web
> > >>> application.
> > >>> I have already fixed lots of small problems to get it working, but
> > >>> this one I can t figure out.
> > >>> The app is:http://toverexpressforever.appspot.com
> > >>> When you click on the register button, a new Spring Web Flow is
> > >>> started and it takes you to the first view-state of the float, /WEB-
> > >>> INF/jsp/subscription/details.jsp
> > >>> Then you can continue in the flow, by clicking on one of the two
> > >>> links. One leads you to another jsp (WEB-INF/jsp/subscription/
> > >>> summary.jsp), the second will lead you back to the homepage /home.do
> > >>> The first time when I try this, it always works... But whenever I try
> > >>> to go to /subscription.do a second time (or 3rd ,4rd, ...) it fails...
> > >>> What am I doing wrong here? He always gives me the error message:
> > >>> Error: Not Found
> > >>> The requested URL /subscription was not found on this server.
> > >>> And in the logs, I see this error message for the /subscription.do
> > >>> URL:
> > >>> #   1. 11-12 01:27AM 36.070 /subscription 404 1ms 0cpu_ms 0kb Mozilla/
> > >>> 5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.4) Gecko/20091016
> > >>> Firefox/3.5.4 (.NET CLR 3.5.30729),gzip(gfe)
> > >>>       See details
> > >>>       ***.***.***.*** - - [12/Nov/2009:01:27:36 -0800] "GET /
> > >>> subscription HTTP/1.1" 404 0 "http://toverexpressforever.appspot.com/";
> > >>> "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.4) Gecko/
> > >>> 20091016 Firefox/3.5.4 (.NET CLR 3.5.30729),gzip(gfe)"
> > >>> "toverexpressforever.appspot.com"
> > >>>    2.
> > >>>       W 11-12 01:27AM 36.070
> > >>>       No handlers matched this URL.
> > >>> Anyone know what I'm doing wrong here? On a local Tomcat server (in
> > >>> Eclipse) it works, as well as with the Eclipse plugin server (by doing
> > >>> Run As -> Web Application)...
> > >>> Any help is greatly appreciated!!
> > >>> Kind regards,
> > >>>DieterH
>
> > > --
>
> > > 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=.

--

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: problem with using session.getAttribute()

2009-11-25 Thread addy.bhardwaj
Guys

I had a similar issue when I was using JSF. What I found in my case
was if I set an attribute  (say dummy string "key" "value") on every
request, the other values stored in the session are maintained.

If I dont do that, on every subsequent request in which nothing is
saved in the session, other saved values are dropped (this happens
only on appspot not dev server). This all started when I tried
debugging my code on appspot. But I still can't comprehend why this is
happening.

Try the approach and let me know if it works in your case as well.

On Nov 25, 1:58 am, Rusty Wright  wrote:
> Did you enable sessions?
>
> http://code.google.com/appengine/docs/java/config/appconfig.html
>
> See the section near the end, Enabling Sessions.
>
>
>
> Steph wrote:
> > I also have the same issue when retrieving session objects from a
> > servlet filter, and running in the local sandbox.
>
> > On Nov 21, 10:11 pm, Sanjay  wrote:
> >> Did you solve this problem? I am facing exactly same problem, it would
> >> be nice if you could share the solution if you found one.
>
> >> Thank you
>
> > --
>
> > 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] Re: Session handleing example

2009-11-25 Thread IlyaE
Obelix,

It looks like in your jsp your calling the helloWorld object. But your
object is called str.

Change
  ${helloWorld}
to
  ${str}

On Nov 18, 12:03 am, Obelix  wrote:
> Ikai
>
> Even this basic page scope isn't working for me.
>
>         public void doGet(HttpServletRequest req, HttpServletResponse resp)
>                         throws IOException, ServletException {
>                 req.setAttribute("helloWorld", "Testing");
>                  RequestDispatcher dispatcher =
>                          req.getRequestDispatcher("/helloworld.jsp");
>                  dispatcher.forward(req, resp);
>         }
>
> <%@ page isELIgnored="false" %>
>
> 
>
> Hello world
>
> <% String str = (String) session.getAttribute("helloWorld");  %>
>
>   ${helloWorld}
>
> 
>
> The value for ${helloWorld} is null.
>
> I am testing this through eclipse.
>
> Google App Engine Java SDK 1.2.6
> Google Web Toolkit SDK 1.7.1
> Google Plugin for Eclipse 3.5
>
> I am running this on mac (snow leopard).
>
> java version "1.6.0_15"
> Java(TM) SE Runtime Environment (build 1.6.0_15-b03-219)
> Java HotSpot(TM) 64-Bit Server VM (build 14.1-b02-90, mixed mode)
>
> On Nov 10, 10:36 am, "Ikai L (Google)"  wrote:
>
>
>
> > Ilya,
>
> > Are you looking to persist objects for a lifetime of a session, or are you
> > looking to minimize the logic you are using in your JSPs?
> > As a general design principle, we recommend that you minimize usage of
> > session scope. Variables bound to session scope are serialized and stored to
> > distributed memory, and as a result, it will work best if you use it to pass
> > around small, simple, immutable objects.
>
> > If you're looking to pass a variable to a view, Java Servlets have a concept
> > of page scope as well as session scope. You don't need to store a variable
> > in session scope if you just want to dispatch the request to a JSP. For
> > instance, you can define a Servlet that looks like this:
>
> > public class MyServlet extends HttpServlet {
>
> >    protected void doGet(HttpServletRequest request, HttpServletResponse
> > response) throws ServletException, IOException {
> >      String myVar = "this is a string that will be passed to the JSP";
> >      request.setAttribute("myVar", myVar);
> >      RequestDispatcher dispatcher =
> > request.getRequestDispatcher("/WEB-INF/my.jsp");
>
> >      dispatcher.forward(request, response);
>
> >    }
>
> > }
>
> > In my.jsp, you can now refer to this variable:
>
> > <%@ page isELIgnored="false" %>
> > 
> >   ${myVar}
> > 
>
> > Ikai Lan
> > Developer Programs Engineer, Google App Engine
>
> > On Tue, Nov 10, 2009 at 2:39 PM, IlyaE  wrote:
>
> > > Well as i found out, session attributes don't always guarantee that
> > > they are sent back to the same JVM thus i keep getting null objects in
> > > my view. While i saw a similar discussion before the only examples i
> > > found were for Python. I'm looking for a simple java example that
> > > saves an object in the servlet and retrieves it in the jsp.
>
> > > On Nov 9, 5:44 pm, victor  wrote:
> > > > What issue are you encountering?
>
> > > > When you make changes to a session object state, make sure to
> > > > explicitly call the session.setAttribute("",  > > > modified session state object>) again.
>
> > > > i think there is an issue discussed about this before.
>
> > > > On Nov 9, 10:58 am, IlyaE  wrote:
>
> > > > > Does anyone have a java session handleing example? It seems that
> > > > > saving objects in the session only works locally.

--

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: Is there a recommended way to differentiate between production and dev GAE environments?

2009-11-25 Thread Jorge
My approach is quite simpler. I keep a configuration file where  I
setup a different webBaseURL depending on the environment, development
VS production. One could a a boolean isProduction and make webBaseURL
a function of that. The thing to remember is to setup the config file
before uploading to GAE and then resetting it back to the development
config.

public class Config {

// True or false the UI actions (buttons) and the http servicce
requests
// are logged.
private static boolean isLogOn = true;

// Web base URL
/private static String webBaseURL = "http://
wcondominios.appspot.com/";
private static String webBaseURL = "http://localhost:8080/";;

/**
 * @return True or false the the UI actions (buttons) and the http
 * servicce requests are logged.
 */
public static boolean isLogOn() {return isLogOn;}

/**
 * @return The Web base URL
 */
public static String getWebBaseURL() {return webBaseURL;}

}

Jorge Gonzalez

On Nov 24, 8:11 pm, Rusty Wright  wrote:
> The filesystem is read only on app engine; would trying to create a file, in 
> WEB-INF for example, work?  I'm wondering if there are corner cases I'm not 
> thinking of where that might fail and falsely report that you're on app 
> engine; for example, if you were doing integration tests under Hudson.
>
> Nacho Coloma wrote:
> > Thanks! I searched a lot but didn't get to this thread.
>
> > On Nov 23, 4:13 pm, leszek  wrote:
> >> Follow that thread:
>
> >>http://groups.google.co.uk/group/google-appengine-java/browse_frm/thr...
>
> > --
>
> > 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=.

--

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] Import/export for Java

2009-11-25 Thread Marcel Overdijk
I'm wondering how the Java utility for exporting/importing data is
making progress.

It's already available for Python but not for Java SDK.

--

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




Re: [appengine-java] Re: out of memory on javax.mail.internet.MimeMultipart.getCount

2009-11-25 Thread david ruescas
I added a trace message, here's the value of
javax.mail.internetMimeMessage.getContentType():

com.dr.reviewengine.MailServlet doPost: multipart content type
text/plain; charset=ISO-8859-1

thankyou

On 11/25/09, m seleron  wrote:
> Hi,
>
> I want you to teach the value of
> [javax.mail.internetMimeMessage.getContentType() ]
> for confirmation.
>
> thanks.
>
> On 11月25日, 午前3:57, david ruescas  wrote:
>> When receiving email I get an out of memory error when calling
>> getCount on the MimeMultipart object.
>>
>> Heres the stack trace:
>>
>> Error for /_ah/mail/rev...@reviewengine.appspotmail.com
>> java.lang.OutOfMemoryError: Java heap space
>>         at java.util.Arrays.copyOf(Unknown Source)
>>         at java.io.ByteArrayOutputStream.write(Unknown Source)
>>         at
>> javax.mail.internet.MimeMultipart.readTillFirstBoundary(MimeMultipart.java:244)
>>         at javax.mail.internet.MimeMultipart.parse(MimeMultipart.java:181)
>>         at
>> javax.mail.internet.MimeMultipart.getCount(MimeMultipart.java:109)
>>         at com.dr.reviewengine.MailServlet.doPost(MailServlet.java:85)
>>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:713)
>>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
>>         at
>> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
>>         at
>> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1093)
>>         at
>> com.google.apphosting.runtime.jetty.SaveSessionFilter.doFilter(SaveSessionFilter.java:35)
>>         at
>> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
>>         at
>> com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)
>>         at
>> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
>>         at
>> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
>>         at
>> org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
>>         at
>> org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
>>         at
>> org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:712)
>>         at
>> org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
>>         at
>> com.google.apphosting.runtime.jetty.AppVersionHandlerMap.handle(AppVersionHandlerMap.java:238)
>>         at
>> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
>>         at org.mortbay.jetty.Server.handle(Server.java:313)
>>         at
>> org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:506)
>>         at
>> org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:830)
>>         at
>> com.google.apphosting.runtime.jetty.RpcRequestParser.parseAvailable(RpcRequestParser.java:76)
>>         at
>> org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:381)
>>         at
>> com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:139)
>>         at
>> com.google.apphosting.runtime.JavaRuntime.handleRequest(JavaRuntime.java:239)
>>         at
>> com.google.apphosting.base.RuntimePb$EvaluationRuntime$6.handleBlockingRequest(RuntimePb.java:5135)
>>         at
>> com.google.apphosting.base.RuntimePb$EvaluationRuntime$6.handleBlockingRequest(RuntimePb.java:5133)
>>         at
>> com.google.net.rpc.impl.BlockingApplicationHandler.handleRequest(BlockingApplicationHandler.java:24)
>>         at
>> com.google.net.rpc.impl.RpcUtil.runRpcInApplication(RpcUtil.java:363)
>
> --
>
> 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.
>
>
>

--

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: Any Sample Authentication Examples using GWT-App Engine

2009-11-25 Thread leszek
http://code.google.com/p/google-web-toolkit-incubator/wiki/LoginSecurityFAQ

--

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] on switching a webapp from RDBMS to GAE/J ( jdo, join, sql )

2009-11-25 Thread K.Honsali
Hi all,

If my understanding of previous discussions is correct, we can resume
from:
- GAE/J is not relational (not full JDO too), and hence does not
support sql features such as joins, like, not in ...etc
- the solution is to de-normalize your tables ... or your mind..

Now, suppose you have a quite big classic sql-based webapp which is
multi-layered like a burger, so it is OK to change the Data Access
Layer without affecting the other components, provided that the DAL
calls and outputs remain the same.
If you want to migrate this app to GAE/J, how would you do; knowing
that beside CRUD queries, you have queries that execute (on the fly w/
sql) up to a dozen joins ?
a )  re-write your DAL in GAE/J's JDO, by denormalizing your tables (&
your mind)
b )  write your own sql wrapper, using full JDO and the low level
datastore (can it be?)
c )  none of the above

Thanks for your CPU time :)

--

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: Error when bulk deleting items

2009-11-25 Thread fence
I caught the timeout and just did a sleep / retry.  I took many days
to delete 1 million rows, is there a more efficient way?

--

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: on switching a webapp from RDBMS to GAE/J ( jdo, join, sql )

2009-11-25 Thread K.Honsali
I would have added
d) use an embedded rdbms, and do own consistency

If there was a way to control running instances like in EC2



On Nov 25, 5:17 pm, "K.Honsali"  wrote:
> Hi all,
>
> If my understanding of previous discussions is correct, we can resume
> from:
> - GAE/J is not relational (not full JDO too), and hence does not
> support sql features such as joins, like, not in ...etc
> - the solution is to de-normalize your tables ... or your mind..
>
> Now, suppose you have a quite big classic sql-based webapp which is
> multi-layered like a burger, so it is OK to change the Data Access
> Layer without affecting the other components, provided that the DAL
> calls and outputs remain the same.
> If you want to migrate this app to GAE/J, how would you do; knowing
> that beside CRUD queries, you have queries that execute (on the fly w/
> sql) up to a dozen joins ?
> a )  re-write your DAL in GAE/J's JDO, by denormalizing your tables (&
> your mind)
> b )  write your own sql wrapper, using full JDO and the low level
> datastore (can it be?)
> c )  none of the above
>
> Thanks for your CPU time :)

--

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] new comer

2009-11-25 Thread Mike
hi, i am the green hand on GAE ,i want to use it to develop some
project .

--

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: Problem in uploading jsp file

2009-11-25 Thread Sahil Mahajan
Hello Stephan

I am new to gae. My JAVA_HOME variable has value "C:\Program Files\Java
\jdk1.6.0_01"
I also checked build.xml, but I could not understand where I need to
mention jdk instead of jre.

Can you give me some more details

Regards
Sahil


On Nov 24, 11:00 pm, Stephan Hartmann  wrote:
> You are using a Java Runtime Environment (JRE) which does not include a
> compiler.
>
> You have to use a JDK instead.
>
> Regards,
> Stephan
>
> sahil mahajan schrieb:
>
>
>
> > Hello
>
> > I am working on java google app engine. When I try to upload my
> > application, I receive following error
>
> > Error Details:
>
> > Nov 24, 2009 10:18:11 PM org.apache.jasper.JspC processFile
>
> > INFO: Built File: \addressbook.jsp
>
> > java.lang.IllegalStateException: cannot find javac executable based on
> > java.home
>
> > , tried "C:\Program Files\Java\jre1.6.0_04\bin\javac.exe" and
> > "C:\Program Files\
>
> > Java\bin\javac.exe"
>
> > Unable to upload app: cannot find javac executable based on java.home,
> > tried "C:
>
> > \Program Files\Java\jre1.6.0_04\bin\javac.exe" and "C:\Program
> > Files\Java\bin\ja
>
> > vac.exe"
>
> > If I remove addressbook.jsp file, error does not occur
>
> > What could be the reason?
>
> > --
>
> > 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.
>
>

--

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




Re: [appengine-java] Import/export for Java

2009-11-25 Thread Ikai L (Google)
In the meantime, there are a few articles about how to do this using the
Python loader for your Java app:

http://blog.notdot.net/2009/9/Advanced-Bulk-Loading-Part-5-Bulk-Loading-for-Java

http://appengine-cookbook.appspot.com/recipe/using-the-python-bulk-exporter-tool-with-a-java-application/?id=ahJhcHBlbmdpbmUtY29va2Jvb2tyigELEgtSZWNpcGVJbmRleCI2YWhKaGNIQmxibWRwYm1VdFkyOXZhMkp2YjJ0eUVnc1NDRU5oZEdWbmIzSjVJZ1JLWVhaaERBDAsSBlJlY2lwZSI3YWhKaGNIQmxibWRwYm1VdFkyOXZhMkp2YjJ0eUVnc1NDRU5oZEdWbmIzSjVJZ1JLWVhaaERBNgw

On Wed, Nov 25, 2009 at 6:50 AM, Marcel Overdijk
wrote:

> I'm wondering how the Java utility for exporting/importing data is
> making progress.
>
> It's already available for Python but not for Java SDK.
>
> --
>
> 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.
>
>
>


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




Re: [appengine-java] Re: any plans for deferred.defer in Java?

2009-11-25 Thread Vince Bonfanti
Hi Jeff,

Thanks for the suggestions and the code. David Chandler sent me a patch to
support user-specified queue names (almost exactly the same as your
changes), and I've committed that patch to SVN. Regarding your other
changes:

  - I've probably make the  init parameter optional and have it
default to "/_ah/" rather than throw an exception from the init
method if it's missing.

  - While we're at it, the default queue name could be optionally specified
by an init parameter also.

  - I'm not sure a stacktrace from the doPost method is really going to give
you much more information, but would be open to that  change.

It looks like the Deferred class is going to be added to the official GAE/J
SDK, though I'm not sure when. Rather than make any more changes to the code
right now, I'd rather wait to see what shows up the SDK and then work
through normal Google channels to get any further modifications made. In the
mean time, I'm glad it's working for you.

Vince

On Tue, Nov 24, 2009 at 8:09 PM, Jeff Schnitzer  wrote:

> Attached is a modified version of that class that lets you define any
> path you want for the servlet and lets you specify which queue to use
> like this: Deferred.defer(task, "queueName");
>
> (I needed this for my own purposes)
>
> Do with it as you wish :-)
>
> The only other major change I would make is to stop masking all the
> exceptions during the task processing.  Or at least, if you're going
> to log the exception and stop propagation, log the whole thing so we
> get a stacktrace in the logs.
>
> Jeff
>
> On Fri, Nov 20, 2009 at 1:03 PM, David Chandler 
> wrote:
> > Vince, this is great! I hadn't been watching my own issue, so didn't
> > see this until now. Thanks so much!
> >
> > Only enhancement I would suggest is to enable multiple deferred
> > queues. For example. I would like to defer tasks in an email throttle
> > queue separately from a general background queue. Perhaps the
> > Deferrable interface could have a getQueueName() method, or
> > Deferred.defer could have an additional signature defer(Deferrable
> > task, String queueName).
> >
> > Thanks again,
> > /dmc
>
> --
>

--

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: out of memory on javax.mail.internet.MimeMultipart.getCount

2009-11-25 Thread Jeremy Blythe
You might be parsing a text/plain as a multipart. I've blogged about
this here 
http://jeremyblythe.blogspot.com/2009/11/receiving-email-in-google-app-engine.html
I think this is a bug in App Engine.

On Nov 25, 3:42 pm, david ruescas  wrote:
> I added a trace message, here's the value of
> javax.mail.internetMimeMessage.getContentType():
>
> com.dr.reviewengine.MailServlet doPost: multipart content type
> text/plain; charset=ISO-8859-1
>
> thankyou
>
> On 11/25/09, m seleron  wrote:
>
> > Hi,
>
> > I want you to teach the value of
> > [javax.mail.internetMimeMessage.getContentType() ]
> > for confirmation.
>
> > thanks.
>
> > On 11月25日, 午前3:57, david ruescas  wrote:
> >> When receiving email I get an out of memory error when calling
> >> getCount on the MimeMultipart object.
>
> >> Heres the stack trace:
>
> >> Error for /_ah/mail/rev...@reviewengine.appspotmail.com
> >> java.lang.OutOfMemoryError: Java heap space
> >>         at java.util.Arrays.copyOf(Unknown Source)
> >>         at java.io.ByteArrayOutputStream.write(Unknown Source)
> >>         at
> >> javax.mail.internet.MimeMultipart.readTillFirstBoundary(MimeMultipart.java:244)
> >>         at javax.mail.internet.MimeMultipart.parse(MimeMultipart.java:181)
> >>         at
> >> javax.mail.internet.MimeMultipart.getCount(MimeMultipart.java:109)
> >>         at com.dr.reviewengine.MailServlet.doPost(MailServlet.java:85)
> >>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:713)
> >>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
> >>         at
> >> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
> >>         at
> >> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1093)
> >>         at
> >> com.google.apphosting.runtime.jetty.SaveSessionFilter.doFilter(SaveSessionFilter.java:35)
> >>         at
> >> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
> >>         at
> >> com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)
> >>         at
> >> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
> >>         at
> >> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
> >>         at
> >> org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
> >>         at
> >> org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
> >>         at
> >> org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:712)
> >>         at
> >> org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
> >>         at
> >> com.google.apphosting.runtime.jetty.AppVersionHandlerMap.handle(AppVersionHandlerMap.java:238)
> >>         at
> >> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
> >>         at org.mortbay.jetty.Server.handle(Server.java:313)
> >>         at
> >> org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:506)
> >>         at
> >> org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:830)
> >>         at
> >> com.google.apphosting.runtime.jetty.RpcRequestParser.parseAvailable(RpcRequestParser.java:76)
> >>         at
> >> org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:381)
> >>         at
> >> com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:139)
> >>         at
> >> com.google.apphosting.runtime.JavaRuntime.handleRequest(JavaRuntime.java:239)
> >>         at
> >> com.google.apphosting.base.RuntimePb$EvaluationRuntime$6.handleBlockingRequest(RuntimePb.java:5135)
> >>         at
> >> com.google.apphosting.base.RuntimePb$EvaluationRuntime$6.handleBlockingRequest(RuntimePb.java:5133)
> >>         at
> >> com.google.net.rpc.impl.BlockingApplicationHandler.handleRequest(BlockingApplicationHandler.java:24)
> >>         at
> >> com.google.net.rpc.impl.RpcUtil.runRpcInApplication(RpcUtil.java:363)
>
> > --
>
> > 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.

--

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




Re: [appengine-java] Re: Weird results for JOD query with List item filter (List.contains(....))

2009-11-25 Thread Ikai L (Google)
Prashant,

Is this happening locally? Is EmailID ever an empty value?

On Tue, Nov 24, 2009 at 9:57 AM, Prashant  wrote:

> Max please help me out, it is killing my app. :(
>
>
> On Tue, Nov 24, 2009 at 8:45 PM, Prashant  wrote:
>
>> this is surely a bug following is my test case
>>
>>
>> PersistenceManager pm = pmf.getPersistenceManager();
>>
>> Query query = pm.newQuery(_Contact.class);
>>
>> query.setOrdering("EmailID");
>> query.setFilter("Groups.contains(\"mygroup\")");
>>
>> int i = 1;
>> for(_Contact cont : (List<_Contact>) query.execute()){
>> resp.getWriter().print(i++ + " " + cont.getID() + "");
>> }
>>
>> pm.close();
>>
>>
>> above code printed 23 contacts and when I replaced  
>> *query.setOrdering("EmailID");
>> *by *query.setOrdering("EmailID desc"); *it printed 18 contacts only.
>>
>
>  --
> 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.
>



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




Re: [appengine-java] Re: Weird results for JOD query with List item filter (List.contains(....))

2009-11-25 Thread Prashant
no, I have tested it on Production Server and EmailID is a primary key so it
cannot be null

--

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: XMPP Message not being received

2009-11-25 Thread Ravi Sharma
Hi Googlers,
Can i have some reply on my problem, its really a stopper for our
application.

*Now one bigger problem we are seeing.*
I send 25(testing with 25 just a number) XMPP message to GAE Application
from my desktop XMPP client
First 10 messages goes and delivered to GAE Application and GAE application
reply it by saying Mesage delivered.

but 11th and onwards message never reach to GAE application(i can see it in
my logs, that my XMPP controller never received the messgae), and but my
client do get a reply from GAE(my application i...@appspot.com) which is same
message as what i sent. This is really weird and big problem. Why my
messages are being returned back to me?. Usally in chat client it happens
when someone is offline. So does it mean that my GAE chat bot has gone
offline? or too busy to respond? or any other problem?

And i ran this test now almost 7-8 times and everytime only first 10
messages are getting delivered.

Then i thought may be its the number of request per seconds, so i started
sending one message per 5 seconds but still no success.Still only 10
messages reaching GAE.

Can any one from google check this problem and give some guidence what is
wrong here

Thanks in advance,
Ravi.




On Wed, Nov 25, 2009 at 9:33 AM, Ravi Sharma  wrote:

> Hi,
> I am trying to write a XMPP Client. When i send a mesage from Client to GAE
> application, it always reach the server and then server reply back. When i
> ran the client first time it worked for 3-4 times. but then now i am not
> receiving any message on client side. I checked the server logs and it says
> that Message sent succesfully.
>
> I am using my gmail id on client side to connect to talk.google.comserver.And 
> i logged out my self from all google client like gmail, gtalk
> etc, as i was thinking may be message is being sent to another client.
> Intrestingky when i am logged in to Gtalk at the time when i am running my
> client, Gtalk recive the response from server. I am using smack libraries
> forXMPP client.
>
> 1) Can you please suggest what can be a problem here.
> 2) Is XMPP communication is 100% delivery system. Is there chance that my
> message will get lost once on server or client i see that message has been
> sent.
>
>
>
> Thanks,
> Ravi.
>

--

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




Re: [appengine-java] Re: Weird results for JOD query with List item filter (List.contains(....))

2009-11-25 Thread Ikai L (Google)
Is this something you can cause to happen in a development environment?

Also, what is your application ID?

On Wed, Nov 25, 2009 at 1:46 PM, Prashant  wrote:

> no, I have tested it on Production Server and EmailID is a primary key so
> it cannot be null
>
>  --
> 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.
>



-- 
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: Import/export for Java

2009-11-25 Thread Marcel Overdijk
Thanks for info Ikai.

But I'm wondering if there is any information available about the Java
exporter/importer.

On 25 nov, 19:44, "Ikai L (Google)"  wrote:
> In the meantime, there are a few articles about how to do this using the
> Python loader for your Java app:
>
> http://blog.notdot.net/2009/9/Advanced-Bulk-Loading-Part-5-Bulk-Loadi...
>
> http://appengine-cookbook.appspot.com/recipe/using-the-python-bulk-ex...
>
> On Wed, Nov 25, 2009 at 6:50 AM, Marcel Overdijk
> wrote:
>
>
>
>
>
> > I'm wondering how the Java utility for exporting/importing data is
> > making progress.
>
> > It's already available for Python but not for Java SDK.
>
> > --
>
> > 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.




Re: [appengine-java] Re: Weird results for JOD query with List item filter (List.contains(....))

2009-11-25 Thread Prashant
actually, I didn't test it on dev server. app id - antshpra

--

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




Re: [appengine-java] Re: Weird results for JOD query with List item filter (List.contains(....))

2009-11-25 Thread Prashant
one more thing I want to ask, earlier I had *Group (String)* instead of *Groups
(List)* , after replacing *Group *by *Groups* my DataStore usage went 13
times of what it was earlier. of course I added more groups per contact,
take an average of 3 groups per contact. why using list makes an entity to
take 12 times more DataStore space? is it not a good practice to use list
property ?

--

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




Re: [appengine-java] Datastore Issues

2009-11-25 Thread Ikai L (Google)
The PM class may be an over-optimization. Can you help me understand what
the purpose of this class is? There shouldn't be any significant costs
associated with opening, closing and retrieving instances of
PersistenceManager.

On Tue, Nov 24, 2009 at 10:34 AM, Jeffrey Goetsch wrote:

> Here is a subset of the code.  It doesn't run or have the logic that
> changes the values.  I have included the ChallengeDao, which highlights what
> I had to do to make work correctly.  If I remove the
> PM.closePersistentManager() it fails in many different ways.  I can even get
> a failure about can't modify multiple entities from different groups in the
> same transaction, and I don't even have transactions.
>
> My goal is to have one PersistenceManager per request.  That way I don't
> have to re-query the objects from datastore twice, because I have read-only
> logic afterwards that packets the data needed for the GWT front end.
>
> Like I said before, I am will to share the entire code base with people
> that are working on these issues in datanucleus code, but not to the entire
> group.  I am willing to answer any questions you might have.
>
> Thanks,
> Jeffrey
>
> public class *PM* {
> private PM() {
> }
>
> static private PersistenceManagerFactory pmfInstance;
> static private HashMap pmSet = new
> HashMap();
> static private HashSet testThreads = new HashSet();
> static private long testId = 0;
> static private HashMap testObj;
>
>
> synchronized static private void createPmfInstance() {
> if (pmfInstance == null) {
> pmfInstance =
> JDOHelper.getPersistenceManagerFactory("transactions-optional");
> }
> }
>
> static public void startTest() {
> testThreads.add(Thread.currentThread());
> }
>
> static public void endTest() {
> testThreads.remove(Thread.currentThread());
> }
>
> static public Long createTestId(Object obj) {
> if (!testThreads.contains(Thread.currentThread())) {
> throw new IllegalStateException
> ("TestId is illegal when PersistenceManagerFactory is
> active");
> }
> if (testObj == null) {
> testObj = new HashMap();
> }
>
> long newId = testId++;
> while (testObj.containsKey(newId)) {
> newId = testId++;
> }
> testObj.put(newId, obj);
> return newId;
> }
>
> static public Long setTestId(long id, Object obj) {
> if (!testThreads.contains(Thread.currentThread())) {
> throw new IllegalStateException
> ("TestId is illegal when PersistenceManagerFactory is
> active");
> }
> if (testObj == null) {
> testObj = new HashMap();
> }
>
> testObj.put(id, obj);
> return id;
> }
>
> static public PersistenceManager getPersistenceManager() {
> if (pmfInstance == null) {
> createPmfInstance();
> }
>
> PersistenceManager pm = pmSet.get(Thread.currentThread());
> if (pm == null) {
> pm = pmfInstance.getPersistenceManager();
> pmSet.put(Thread.currentThread(), pm);
> }
>
> return pm;
> }
>
> static public void closePersistenceManager() {
> PersistenceManager pm = pmSet.remove(Thread.currentThread());
> if (pm != null) {
> pm.close();
> }
> }
>
> static public void rollbackPersistenceManager() {
> org.datanucleus.jdo.JDOPersistenceManager pm =
> (JDOPersistenceManager) PM.getPersistenceManager();
> ObjectManager om = pm.getObjectManager();
> om.clearDirty();
> PM.closePersistenceManager();
> }
>
> static public  T getObjectById(Class cls, Object key) {
> Object obj;
> if (testThreads.contains(Thread.currentThread())) {
> obj = testObj.get(key);
> } else {
> obj = getPersistenceManager().getObjectById(cls, key);
> }
>
> return (T) obj;
> }
>
> static public  Collection getObjectsById(Class cls,
> Collection keys) {
> Collection collection = new LinkedList();
> if (testThreads.contains(Thread.currentThread())) {
> if (keys != null && !keys.isEmpty()) {
> for (Object key : keys) {
> collection.add((T) testObj.get(key));
> }
> }
> } else {
> if (keys != null && !keys.isEmpty()) {
> //TODO this is not optimized for Batch gets - switch to low
> level api
> PersistenceManager pm = getPersistenceManager();
> LinkedList oids = new LinkedList();
> for (Object key : keys) {
> oids.addLast(pm.newObjectIdInstance(cls, key));
> }
> collection = pm.getObjectsById(oids);
> }
> }
>
> return collection;
> }
> }
>

Re: [appengine-java] Re: out of memory on javax.mail.internet.MimeMultipart.getCount

2009-11-25 Thread david ruescas
Thank you Jeremy, that may indeed be it. I'll give it a try shortly

Incidentally, what does your  IOUtils.toString look like? Does it use
an InputStreamReader combined with a StringWriter? Im using

StringWriter sw = new StringWriter();
char[] buffer = new char[1024];
for (int n; (n = r.read(buffer)) != -1; )  {
sw.write(buffer, 0, n);
}

Just checking im doing things the most standard way possible.

thanks again

David

On 11/25/09, Jeremy Blythe  wrote:
> You might be parsing a text/plain as a multipart. I've blogged about
> this here
> http://jeremyblythe.blogspot.com/2009/11/receiving-email-in-google-app-engine.html
> I think this is a bug in App Engine.
>
> On Nov 25, 3:42 pm, david ruescas  wrote:
>> I added a trace message, here's the value of
>> javax.mail.internetMimeMessage.getContentType():
>>
>> com.dr.reviewengine.MailServlet doPost: multipart content type
>> text/plain; charset=ISO-8859-1
>>
>> thankyou
>>
>> On 11/25/09, m seleron  wrote:
>>
>> > Hi,
>>
>> > I want you to teach the value of
>> > [javax.mail.internetMimeMessage.getContentType() ]
>> > for confirmation.
>>
>> > thanks.
>>
>> > On 11月25日, 午前3:57, david ruescas  wrote:
>> >> When receiving email I get an out of memory error when calling
>> >> getCount on the MimeMultipart object.
>>
>> >> Heres the stack trace:
>>
>> >> Error for /_ah/mail/rev...@reviewengine.appspotmail.com
>> >> java.lang.OutOfMemoryError: Java heap space
>> >>         at java.util.Arrays.copyOf(Unknown Source)
>> >>         at java.io.ByteArrayOutputStream.write(Unknown Source)
>> >>         at
>> >> javax.mail.internet.MimeMultipart.readTillFirstBoundary(MimeMultipart.java:244)
>> >>         at
>> >> javax.mail.internet.MimeMultipart.parse(MimeMultipart.java:181)
>> >>         at
>> >> javax.mail.internet.MimeMultipart.getCount(MimeMultipart.java:109)
>> >>         at com.dr.reviewengine.MailServlet.doPost(MailServlet.java:85)
>> >>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:713)
>> >>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
>> >>         at
>> >> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
>> >>         at
>> >> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1093)
>> >>         at
>> >> com.google.apphosting.runtime.jetty.SaveSessionFilter.doFilter(SaveSessionFilter.java:35)
>> >>         at
>> >> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
>> >>         at
>> >> com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)
>> >>         at
>> >> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
>> >>         at
>> >> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
>> >>         at
>> >> org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
>> >>         at
>> >> org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
>> >>         at
>> >> org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:712)
>> >>         at
>> >> org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
>> >>         at
>> >> com.google.apphosting.runtime.jetty.AppVersionHandlerMap.handle(AppVersionHandlerMap.java:238)
>> >>         at
>> >> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
>> >>         at org.mortbay.jetty.Server.handle(Server.java:313)
>> >>         at
>> >> org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:506)
>> >>         at
>> >> org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:830)
>> >>         at
>> >> com.google.apphosting.runtime.jetty.RpcRequestParser.parseAvailable(RpcRequestParser.java:76)
>> >>         at
>> >> org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:381)
>> >>         at
>> >> com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:139)
>> >>         at
>> >> com.google.apphosting.runtime.JavaRuntime.handleRequest(JavaRuntime.java:239)
>> >>         at
>> >> com.google.apphosting.base.RuntimePb$EvaluationRuntime$6.handleBlockingRequest(RuntimePb.java:5135)
>> >>         at
>> >> com.google.apphosting.base.RuntimePb$EvaluationRuntime$6.handleBlockingRequest(RuntimePb.java:5133)
>> >>         at
>> >> com.google.net.rpc.impl.BlockingApplicationHandler.handleRequest(BlockingApplicationHandler.java:24)
>> >>         at
>> >> com.google.net.rpc.impl.RpcUtil.runRpcInApplication(RpcUtil.java:363)
>>
>> > --
>>
>> > 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.g

Re: [appengine-java] Re: Weird results for JOD query with List item filter (List.contains(....))

2009-11-25 Thread Ikai L (Google)
The extra space likely comes from indexes. You can check your indexes in
your "Indexes" tab. For a better understanding of how indexes work, here is
a good session from Google I/O that discusses the topic:

https://sites.google.com/site/io/under-the-covers-of-the-google-app-engine-datastore


On Wed, Nov 25, 2009 at 2:01 PM, Prashant  wrote:

> one more thing I want to ask, earlier I had *Group (String)* instead of 
> *Groups
> (List)* , after replacing *Group *by *Groups* my DataStore usage went 13
> times of what it was earlier. of course I added more groups per contact,
> take an average of 3 groups per contact. why using list makes an entity to
> take 12 times more DataStore space? is it not a good practice to use list
> property ?
>
>  --
> 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.
>



-- 
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: Type Owned by Two Different Types?

2009-11-25 Thread dhm
I tried to get around this problem by having ParentOfOne "own" the
shared class but ParentOfList @Persistent List instead of its
List. That only worked when I put an explicit
@NonPersistent on the List.

No instances of either class point to the same instances of the shared
class. The shared class instances are truly dependent (lifecycle
should depend on instance which points to them), but I'm willing to
decouple for the ParentOfList, but this bug should be fixed imho. It
greatly limits the OOD and abstraction of the datastore.


On Sep 30, 9:02 am, objectuser  wrote:
> Filed:
>
> http://code.google.com/p/datanucleus-appengine/issues/detail?id=138
>
> On Sep 29, 2:05 pm, "Jason (Google)"  wrote:
>
>
>
> > Thank you for filing the issue, objectuser. Can you file it in the
> > datanucleus-appengine project's issue tracker too?
>
> >http://code.google.com/p/datanucleus-appengine/issues/list
>
> > Thanks,
> > - Jason
>
> > On Sat, Sep 26, 2009 at 6:44 AM, objectuser  wrote:
>
> > > Defect reported:
>
> > >http://code.google.com/p/googleappengine/issues/detail?id=2170
>
> > > On Sep 24, 4:22 am, Marton Papp  wrote:
> > > > Hi!
>
> > > > Your problem is strange indeed. The interesting thing is that
> > > > persisting both types of parents works well if you do it separately.
> > > > It also works if you switch the order of persisting the objects,
> > > > starting with ParentOfOne and then ParentOfList. It also fails if you
> > > > only do a query on ParentOfList before persisting an instance of
> > > > ParentOfOne. That means persisting of ParentOfOne is failing after
> > > > ParentOfList has been recognised as a persistable class.  And it
> > > > really seems to be related to mapping the children as a List, because
> > > > if I remove that mapping then everything works fine. I suggest you
> > > > raise an issue about this.
>
> > > > Marton
>
> > > > On Sep 24, 2:51 am, objectuser  wrote:
>
> > > > > Here's some code that reproduces my problem.  Before the code, I think
> > > > > it's interesting to note that I started making this example in JPA
> > > > > (because I had an old test that used JPA) and I was not able to
> > > > > reproduce the error.  However, after converting to JDO, I get the
> > > > > error.  I'm not 100% sure the code is exactly the same, however, but
> > > > > wanted to note it in case it's helpful to anyone.
>
> > > > > LocalServiceTestCase is based on the examples from Google.
>
> > > > > Does anyone see a problem with the code or is this a legit bug?
>
> > > > > @PersistenceCapable(identityType = IdentityType.APPLICATION,
> > > > > detachable = "true")
> > > > > public class ParentOfOne {
>
> > > > >         @PrimaryKey
> > > > >         @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
> > > > >         private Long id;
>
> > > > >         @Persistent
> > > > >         private SharedChild child;
> > > > >         ...
>
> > > > > }
>
> > > > > @PersistenceCapable(identityType = IdentityType.APPLICATION,
> > > > > detachable = "true")
> > > > > public class ParentOfList {
>
> > > > >         @PrimaryKey
> > > > >         @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
> > > > >         private Long id;
>
> > > > >         @Persistent
> > > > >         private List children;
> > > > >         ...
>
> > > > > }
>
> > > > > @PersistenceCapable(identityType = IdentityType.APPLICATION,
> > > > > detachable = "true")
> > > > > public class SharedChild {
>
> > > > >         @PrimaryKey
> > > > >         @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
> > > > >         private Key id;
>
> > > > >         @Persistent
> > > > >         private String name;
> > > > >         ...
>
> > > > > }
>
> > > > > public class SharedChildTestCase extends LocalServiceTestCase {
>
> > > > >         private PersistenceManager persistenceManager;
>
> > > > >         @Before
> > > > >         public void openPersistenceManager() {
> > > > >                 PersistenceManagerFactory persistenceManagerFactory =
> > > JDOHelper
>
> > > .getPersistenceManagerFactory("transactions-optional");
> > > > >                 persistenceManager =
> > > persistenceManagerFactory.getPersistenceManager
> > > > > ();
> > > > >         }
>
> > > > >         @After
> > > > >         public void closePersitenceManager() {
> > > > >                 persistenceManager.close();
> > > > >         }
>
> > > > >         @Test
> > > > >         public void saveParents() {
> > > > >                 ParentOfList pol = new ParentOfList();
> > > > >                 List list = new ArrayList();
> > > > >                 SharedChild c1 = new SharedChild();
> > > > >                 c1.setName("c1");
> > > > >                 list.add(c1);
> > > > >                 SharedChild c2 = new SharedChild();
> > > > >                 c2.setName("c2");
> > > > >                 list.add(c2);
> > > > >                 pol.setChildren(list);
> > > > >                 persistenceManager.makePersistent(pol);
>
> > > > >                

[appengine-java] Implementing Authorize.NET Integration with Custom Domain.

2009-11-25 Thread _yoko_
Hey Guys,
 I have some basic questions. I just started using Java-GAE and am
trying to figure out if my site can be ported to GAE.


 How can I do the following(I have a custom domain say abc.com and an
appspot domain say abcd.appspot.com):
  1. Implement an SSL based login page. My site required data like
users SSN number, so it can not be unencrypted and the Google Login or
any other Open ID login would not suffice.

  2. Custom integrate with Authorize.NET. I do not want the user to
leave my site when entering their Credit Card Details etc.


Any insight into these two issues would really be helpful.


Regards,


Yoko

--

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




Re: [appengine-java] Re: Error when bulk deleting items

2009-11-25 Thread Ikai L (Google)
One technique you can look into is breaking this into small tasks on the
server and using the background Task Queue to clear your datastore. You can
have the tasks create new tasks as needed and parallelize the delete as much
as possible.

On Wed, Nov 25, 2009 at 8:41 AM, fence  wrote:

> I caught the timeout and just did a sleep / retry.  I took many days
> to delete 1 million rows, is there a more efficient way?
>
> --
>
> 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.
>
>
>


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




Re: [appengine-java] Re: on switching a webapp from RDBMS to GAE/J ( jdo, join, sql )

2009-11-25 Thread Ikai L (Google)
Your first option is what we recommend. App Engine's data model is similar
to that of a federated data model based on sharded relational databases.
Here's a pretty good session from Google I/O 2009 about migrating to/from
RDBMS:

http://code.google.com/events/io/2009/sessions/SofterSideofSchemas.html

On Wed, Nov 25, 2009 at 9:40 AM, K.Honsali  wrote:

> I would have added
> d) use an embedded rdbms, and do own consistency
>
> If there was a way to control running instances like in EC2
>
>
>
> On Nov 25, 5:17 pm, "K.Honsali"  wrote:
> > Hi all,
> >
> > If my understanding of previous discussions is correct, we can resume
> > from:
> > - GAE/J is not relational (not full JDO too), and hence does not
> > support sql features such as joins, like, not in ...etc
> > - the solution is to de-normalize your tables ... or your mind..
> >
> > Now, suppose you have a quite big classic sql-based webapp which is
> > multi-layered like a burger, so it is OK to change the Data Access
> > Layer without affecting the other components, provided that the DAL
> > calls and outputs remain the same.
> > If you want to migrate this app to GAE/J, how would you do; knowing
> > that beside CRUD queries, you have queries that execute (on the fly w/
> > sql) up to a dozen joins ?
> > a )  re-write your DAL in GAE/J's JDO, by denormalizing your tables (&
> > your mind)
> > b )  write your own sql wrapper, using full JDO and the low level
> > datastore (can it be?)
> > c )  none of the above
> >
> > Thanks for your CPU time :)
>
> --
>
> 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.
>
>
>


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




Re: [appengine-java] Re: out of memory on javax.mail.internet.MimeMultipart.getCount

2009-11-25 Thread david ruescas
It worked, cheers

On 11/25/09, david ruescas  wrote:
> Thank you Jeremy, that may indeed be it. I'll give it a try shortly
>
> Incidentally, what does your  IOUtils.toString look like? Does it use
> an InputStreamReader combined with a StringWriter? Im using
>
> StringWriter sw = new StringWriter();
> char[] buffer = new char[1024];
> for (int n; (n = r.read(buffer)) != -1; )  {
> sw.write(buffer, 0, n);
> }
>
> Just checking im doing things the most standard way possible.
>
> thanks again
>
> David
>
> On 11/25/09, Jeremy Blythe  wrote:
>> You might be parsing a text/plain as a multipart. I've blogged about
>> this here
>> http://jeremyblythe.blogspot.com/2009/11/receiving-email-in-google-app-engine.html
>> I think this is a bug in App Engine.
>>
>> On Nov 25, 3:42 pm, david ruescas  wrote:
>>> I added a trace message, here's the value of
>>> javax.mail.internetMimeMessage.getContentType():
>>>
>>> com.dr.reviewengine.MailServlet doPost: multipart content type
>>> text/plain; charset=ISO-8859-1
>>>
>>> thankyou
>>>
>>> On 11/25/09, m seleron  wrote:
>>>
>>> > Hi,
>>>
>>> > I want you to teach the value of
>>> > [javax.mail.internetMimeMessage.getContentType() ]
>>> > for confirmation.
>>>
>>> > thanks.
>>>
>>> > On 11月25日, 午前3:57, david ruescas  wrote:
>>> >> When receiving email I get an out of memory error when calling
>>> >> getCount on the MimeMultipart object.
>>>
>>> >> Heres the stack trace:
>>>
>>> >> Error for /_ah/mail/rev...@reviewengine.appspotmail.com
>>> >> java.lang.OutOfMemoryError: Java heap space
>>> >>         at java.util.Arrays.copyOf(Unknown Source)
>>> >>         at java.io.ByteArrayOutputStream.write(Unknown Source)
>>> >>         at
>>> >> javax.mail.internet.MimeMultipart.readTillFirstBoundary(MimeMultipart.java:244)
>>> >>         at
>>> >> javax.mail.internet.MimeMultipart.parse(MimeMultipart.java:181)
>>> >>         at
>>> >> javax.mail.internet.MimeMultipart.getCount(MimeMultipart.java:109)
>>> >>         at
>>> >> com.dr.reviewengine.MailServlet.doPost(MailServlet.java:85)
>>> >>         at
>>> >> javax.servlet.http.HttpServlet.service(HttpServlet.java:713)
>>> >>         at
>>> >> javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
>>> >>         at
>>> >> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
>>> >>         at
>>> >> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1093)
>>> >>         at
>>> >> com.google.apphosting.runtime.jetty.SaveSessionFilter.doFilter(SaveSessionFilter.java:35)
>>> >>         at
>>> >> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
>>> >>         at
>>> >> com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)
>>> >>         at
>>> >> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
>>> >>         at
>>> >> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
>>> >>         at
>>> >> org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
>>> >>         at
>>> >> org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
>>> >>         at
>>> >> org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:712)
>>> >>         at
>>> >> org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
>>> >>         at
>>> >> com.google.apphosting.runtime.jetty.AppVersionHandlerMap.handle(AppVersionHandlerMap.java:238)
>>> >>         at
>>> >> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
>>> >>         at org.mortbay.jetty.Server.handle(Server.java:313)
>>> >>         at
>>> >> org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:506)
>>> >>         at
>>> >> org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:830)
>>> >>         at
>>> >> com.google.apphosting.runtime.jetty.RpcRequestParser.parseAvailable(RpcRequestParser.java:76)
>>> >>         at
>>> >> org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:381)
>>> >>         at
>>> >> com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:139)
>>> >>         at
>>> >> com.google.apphosting.runtime.JavaRuntime.handleRequest(JavaRuntime.java:239)
>>> >>         at
>>> >> com.google.apphosting.base.RuntimePb$EvaluationRuntime$6.handleBlockingRequest(RuntimePb.java:5135)
>>> >>         at
>>> >> com.google.apphosting.base.RuntimePb$EvaluationRuntime$6.handleBlockingRequest(RuntimePb.java:5133)
>>> >>         at
>>> >> com.google.net.rpc.impl.BlockingApplicationHandler.handleRequest(BlockingApplicationHandler.java:24)
>>> >>         at
>>> >> com.google.net.rpc.impl.RpcUtil.runRpcInApplication(RpcUtil.java:363)
>>>
>>> > --
>>>
>>> > 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-

Re: [appengine-java] Datastore Issues

2009-11-25 Thread Jeffrey Goetsch
The purpose of the PM class is to abstract the PersistenceManager away from
my logic.  Because the datastore doesn't allow unowned relationships, my
business logic which is located in the Persisted objects, must retrieve the
objects to perform there tasks.  The PM object allows me to write Unit Tests
that don't touch the Datastore, and just test the Logic.  Maybe I can
simplify the Thread Map of PersistenceManagers, but I think it makes it very
understandable for someone unfamiliar with the JDO implementation.

There may be no cost to creating, and retrieving the PersistenceManager, but
there is a large cost to closing one.  If I am going to change an object
twice, and I close the persistence manager in between writes, then I have
effectively doubled my writing and reading cost, because I have to retrieve
and write the object twice.

In my case, I change object values many times while processing some of the
logic, and then reuse those objects later to create Data Packet for the
client app.  It just made sense to open 1 persistence manager at the
beginning of every request and then close it when the request is over.
This design worked perfectly fine with Hibernate, so I figured it would have
been a simple port.  But NO.

Thanks,
--Jeff

On Wed, Nov 25, 2009 at 2:05 PM, Ikai L (Google)  wrote:

> The PM class may be an over-optimization. Can you help me understand what
> the purpose of this class is? There shouldn't be any significant costs
> associated with opening, closing and retrieving instances of
> PersistenceManager.
>
> On Tue, Nov 24, 2009 at 10:34 AM, Jeffrey Goetsch wrote:
>
>> Here is a subset of the code.  It doesn't run or have the logic that
>> changes the values.  I have included the ChallengeDao, which highlights what
>> I had to do to make work correctly.  If I remove the
>> PM.closePersistentManager() it fails in many different ways.  I can even get
>> a failure about can't modify multiple entities from different groups in the
>> same transaction, and I don't even have transactions.
>>
>> My goal is to have one PersistenceManager per request.  That way I don't
>> have to re-query the objects from datastore twice, because I have read-only
>> logic afterwards that packets the data needed for the GWT front end.
>>
>> Like I said before, I am will to share the entire code base with people
>> that are working on these issues in datanucleus code, but not to the entire
>> group.  I am willing to answer any questions you might have.
>>
>> Thanks,
>> Jeffrey
>>
>> public class *PM* {
>> private PM() {
>> }
>>
>> static private PersistenceManagerFactory pmfInstance;
>> static private HashMap pmSet = new
>> HashMap();
>> static private HashSet testThreads = new HashSet();
>> static private long testId = 0;
>> static private HashMap testObj;
>>
>>
>> synchronized static private void createPmfInstance() {
>> if (pmfInstance == null) {
>> pmfInstance =
>> JDOHelper.getPersistenceManagerFactory("transactions-optional");
>> }
>> }
>>
>> static public void startTest() {
>> testThreads.add(Thread.currentThread());
>> }
>>
>> static public void endTest() {
>> testThreads.remove(Thread.currentThread());
>> }
>>
>> static public Long createTestId(Object obj) {
>> if (!testThreads.contains(Thread.currentThread())) {
>> throw new IllegalStateException
>> ("TestId is illegal when PersistenceManagerFactory is
>> active");
>> }
>> if (testObj == null) {
>> testObj = new HashMap();
>> }
>>
>> long newId = testId++;
>> while (testObj.containsKey(newId)) {
>> newId = testId++;
>> }
>> testObj.put(newId, obj);
>> return newId;
>> }
>>
>> static public Long setTestId(long id, Object obj) {
>> if (!testThreads.contains(Thread.currentThread())) {
>> throw new IllegalStateException
>> ("TestId is illegal when PersistenceManagerFactory is
>> active");
>> }
>> if (testObj == null) {
>> testObj = new HashMap();
>> }
>>
>> testObj.put(id, obj);
>> return id;
>> }
>>
>> static public PersistenceManager getPersistenceManager() {
>> if (pmfInstance == null) {
>> createPmfInstance();
>> }
>>
>> PersistenceManager pm = pmSet.get(Thread.currentThread());
>> if (pm == null) {
>> pm = pmfInstance.getPersistenceManager();
>> pmSet.put(Thread.currentThread(), pm);
>> }
>>
>> return pm;
>> }
>>
>> static public void closePersistenceManager() {
>> PersistenceManager pm = pmSet.remove(Thread.currentThread());
>> if (pm != null) {
>> pm.close();
>> }
>> }
>>
>> static public void rollbackPersistenceManager() {
>> org.datanucleus.jdo.JDOPersistenceManager pm =
>> (JDOPer

[appengine-java] Re: select count(*) ?

2009-11-25 Thread James H
Jason, the problem with the "increment a counter on your own" trick is
that would be in a separate Transaction and thus, unreliably linked to
the first insert Transaction right?

Also, the Stats hook mentioned above is NOT realtime is it?  I believe
I read it is updated "at least once a day".

On Oct 21, 12:54 pm, "Jason (Google)"  wrote:
> The query restrictions are an artifact of the way App Engine's datastore is
> constructed, which makes certain operations (e.g. queries and reads) very
> fast and scalable but does limit the types of queries you can make, though
> you can typically get around these restrictions by re-thinking your model a
> bit.
>
> We are working on adding built-in cursor support for easier paging through
> entities and have just added a datastore statistics API for, among other
> things, getting the total entity count, even if it exceeds 1,000. More
> details here:
>
> http://code.google.com/appengine/docs/java/datastore/stats.html
>
> And we also have a data export utility included with the SDK to make it
> easier for you to back up or even move off of App Engine should you choose
> to, and we're continuing to look at ways of making App Engine, particularly
> the datastore component, easier to use.
>
> http://code.google.com/appengine/docs/python/tools/uploadingdata.html...
>
> - Jason
>
>
>
> On Mon, Oct 19, 2009 at 1:53 PM, vetch  wrote:
>
> > On 6 Paź, 10:03, "Jason (Google)"  wrote:
> > > * Because App Engine queries can only return up to 1,000 results,
> > > count(this) will never return above 1,000, even if you have more than
> > 1,000
> > > entities, so bear this in mind.
>
> > I'm deeply shocked. This works like some black hole.
>
> > You put your data there simply, but can't get them back that simply.
>
> > In connection with restricions (inequality property filter), it is
> > even harder to get anything more complex.
>
> > BiGAppEngine disappointment.- Hide quoted text -
>
> - Show quoted text -

--

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: on switching a webapp from RDBMS to GAE/J ( jdo, join, sql )

2009-11-25 Thread Roy
I have an ant task which will reverse engineer a database and create a
GAE LLAPI DAL.
Eg if your database is dept Hi all,
>
> If my understanding of previous discussions is correct, we can resume
> from:
> - GAE/J is not relational (not full JDO too), and hence does not
> support sql features such as joins, like, not in ...etc
> - the solution is to de-normalize your tables ... or your mind..
>
> Now, suppose you have a quite big classic sql-based webapp which is
> multi-layered like a burger, so it is OK to change the Data Access
> Layer without affecting the other components, provided that the DAL
> calls and outputs remain the same.
> If you want to migrate this app to GAE/J, how would you do; knowing
> that beside CRUD queries, you have queries that execute (on the fly w/
> sql) up to a dozen joins ?
> a )  re-write your DAL in GAE/J's JDO, by denormalizing your tables (&
> your mind)
> b )  write your own sql wrapper, using full JDO and the low level
> datastore (can it be?)
> c )  none of the above
>
> Thanks for your CPU time :)

--

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




Re: [appengine-java] Implementing Authorize.NET Integration with Custom Domain.

2009-11-25 Thread Rusty Wright
For item 1, my usual response is to have a look at Spring Security (aka Acegi). 
 It's probably the most flexible.

For item 2, my memory of how Authorize.net's credit card service works (which 
is similar to CyberSource's Hosted Order Page) is that at the point (page) 
where the customer enters their credit card information, they are flipped over 
to the Authorize.net server.  The Authorize.net server then sends (POSTs) to 
your web application some encrypted stuff telling you if the credit card 
transaction was approved, and the customer is flipped back to your server.  
(Flipped == redirected.)  The whole point of doing it that way is so that your 
system never touches or sees the credit card information; the credit card 
industry's compliance rules (aka PCI) are unbelievably onerous if your system 
sees the credit card number in any way, even if it never stores it anywhere.  
It's not too difficult to get set up and I found the Authorize.net 
documentation decent (much better than CyberSource's, but this was a year or so 
ago).


_yoko_ wrote:
> Hey Guys,
>  I have some basic questions. I just started using Java-GAE and am
> trying to figure out if my site can be ported to GAE.
> 
> 
>  How can I do the following(I have a custom domain say abc.com and an
> appspot domain say abcd.appspot.com):
>   1. Implement an SSL based login page. My site required data like
> users SSN number, so it can not be unencrypted and the Google Login or
> any other Open ID login would not suffice.
> 
>   2. Custom integrate with Authorize.NET. I do not want the user to
> leave my site when entering their Credit Card Details etc.
> 
> 
> Any insight into these two issues would really be helpful.
> 
> 
> Regards,
> 
> 
> Yoko
> 
> --
> 
> 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.
> 
> 

--

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: out of memory on javax.mail.internet.MimeMultipart.getCount

2009-11-25 Thread Jeremy Blythe
IOUtils is in Apache Commons IO. The implementation is similar though.

On Nov 25, 10:06 pm, david ruescas  wrote:
> Thank you Jeremy, that may indeed be it. I'll give it a try shortly
>
> Incidentally, what does your  IOUtils.toString look like? Does it use
> an InputStreamReader combined with a StringWriter? Im using
>
> StringWriter sw = new StringWriter();
> char[] buffer = new char[1024];
> for (int n; (n = r.read(buffer)) != -1; )  {
> sw.write(buffer, 0, n);
>
> }
>
> Just checking im doing things the most standard way possible.
>
> thanks again
>
> David
>
> On 11/25/09, Jeremy Blythe  wrote:
>
> > You might be parsing a text/plain as a multipart. I've blogged about
> > this here
> >http://jeremyblythe.blogspot.com/2009/11/receiving-email-in-google-ap...
> > I think this is a bug in App Engine.
>
> > On Nov 25, 3:42 pm, david ruescas  wrote:
> >> I added a trace message, here's the value of
> >> javax.mail.internetMimeMessage.getContentType():
>
> >> com.dr.reviewengine.MailServlet doPost: multipart content type
> >> text/plain; charset=ISO-8859-1
>
> >> thankyou
>
> >> On 11/25/09, m seleron  wrote:
>
> >> > Hi,
>
> >> > I want you to teach the value of
> >> > [javax.mail.internetMimeMessage.getContentType() ]
> >> > for confirmation.
>
> >> > thanks.
>
> >> > On 11月25日, 午前3:57, david ruescas  wrote:
> >> >> When receiving email I get an out of memory error when calling
> >> >> getCount on the MimeMultipart object.
>
> >> >> Heres the stack trace:
>
> >> >> Error for /_ah/mail/rev...@reviewengine.appspotmail.com
> >> >> java.lang.OutOfMemoryError: Java heap space
> >> >>         at java.util.Arrays.copyOf(Unknown Source)
> >> >>         at java.io.ByteArrayOutputStream.write(Unknown Source)
> >> >>         at
> >> >> javax.mail.internet.MimeMultipart.readTillFirstBoundary(MimeMultipart.java:244)
> >> >>         at
> >> >> javax.mail.internet.MimeMultipart.parse(MimeMultipart.java:181)
> >> >>         at
> >> >> javax.mail.internet.MimeMultipart.getCount(MimeMultipart.java:109)
> >> >>         at com.dr.reviewengine.MailServlet.doPost(MailServlet.java:85)
> >> >>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:713)
> >> >>         at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
> >> >>         at
> >> >> org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
> >> >>         at
> >> >> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1093)
> >> >>         at
> >> >> com.google.apphosting.runtime.jetty.SaveSessionFilter.doFilter(SaveSessionFilter.java:35)
> >> >>         at
> >> >> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
> >> >>         at
> >> >> com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)
> >> >>         at
> >> >> org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
> >> >>         at
> >> >> org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
> >> >>         at
> >> >> org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
> >> >>         at
> >> >> org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
> >> >>         at
> >> >> org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:712)
> >> >>         at
> >> >> org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
> >> >>         at
> >> >> com.google.apphosting.runtime.jetty.AppVersionHandlerMap.handle(AppVersionHandlerMap.java:238)
> >> >>         at
> >> >> org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:139)
> >> >>         at org.mortbay.jetty.Server.handle(Server.java:313)
> >> >>         at
> >> >> org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:506)
> >> >>         at
> >> >> org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:830)
> >> >>         at
> >> >> com.google.apphosting.runtime.jetty.RpcRequestParser.parseAvailable(RpcRequestParser.java:76)
> >> >>         at
> >> >> org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:381)
> >> >>         at
> >> >> com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:139)
> >> >>         at
> >> >> com.google.apphosting.runtime.JavaRuntime.handleRequest(JavaRuntime.java:239)
> >> >>         at
> >> >> com.google.apphosting.base.RuntimePb$EvaluationRuntime$6.handleBlockingRequest(RuntimePb.java:5135)
> >> >>         at
> >> >> com.google.apphosting.base.RuntimePb$EvaluationRuntime$6.handleBlockingRequest(RuntimePb.java:5133)
> >> >>         at
> >> >> com.google.net.rpc.impl.BlockingApplicationHandler.handleRequest(BlockingApplicationHandler.java:24)
> >> >>         at
> >> >> com.google.net.rpc.impl.RpcUtil.runRpcInApplication(RpcUtil.java:363)
>
> >> > --
>
> >> > You received this message because you are subscribed to the Google
> >> > Groups
> >>