[appengine-java] What Does Hosted SQL Entail?

2010-09-26 Thread Stefan
I'm trying to figure out if a traditional RDBMS will support my
companies needs better than the given Google Datastore(BigTable).  The
fact is that I don't know what the available RDBMS is/are and can't
seem to find any info on what is out there. Do you know what the
available options are, short of me calling sales? Please advise.

Stefan

-- 
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 Management on GAE

2010-11-29 Thread Stefan
Hi Alexander,

Google also provides a servlet to help with deleting stale session
info. Have a look at this thread:

http://groups.google.com/group/google-appengine-java/browse_thread/thread/4f0d9af1c633d39a

Best regards,
Stefan

On 23 Nov., 18:06, Alexander Arendar 
wrote:
> thank you Stephen :) you really helped
>
> On Tue, Nov 23, 2010 at 6:31 PM, Stephen Johnson 
> wrote:
>
>
>
>
>
>
>
> > Hi Alexander,
> > I'm sorry but I don't work for Google (however I did stay at a Holiday Inn
> > Express last night) so I can't write it in the docs this information and I
> > don't know that it's documented anywhere. Also note that the _ah_SESSION
> > table does not remove expired sessions, you will need to clean up this
> > yourself.
> > Stephen
>
> > On Mon, Nov 22, 2010 at 12:43 PM, Alexander Arendar <
> > alexander.aren...@gmail.com> wrote:
>
> >> Hi Stephen,
>
> >> Would also be great if you write such limitations somewhere in the
> >> documentation.
> >> Or maybe it is already described but I missed the link. In such case
> >> please drop the link.
>
> >> Sincerely,
> >> Alex
>
> >> On Mon, Nov 22, 2010 at 8:39 PM, Stephen Johnson 
> >> wrote:
>
> >>> From what I know you don't get sessionDestroyed. I believe there's a
> >>> couple of issues with notification of a destroyed session and the most
> >>> significant one would be that there's no guarantee that an instance of 
> >>> your
> >>> application will even be running (1.4.0 will allow reserved instances but
> >>> that isn't out yet.) Other issues would be that since this is a 
> >>> distributed
> >>> environment which instance should receive sessionDestroyed. GAE would have
> >>> to implement this one their backend. I believe sessions currently are just
> >>> created by the Servlet Context of an instance when necessary and that
> >>> instance's sessionCreated is the one that is executed.
>
> >>> You however can query the _ah_SESSION table to see if a given session is
> >>> still active or has expired.
>
> >>> On Mon, Nov 22, 2010 at 9:32 AM, Sergiy Arendar <7ser...@gmail.com>wrote:
>
> >>>> Hi, I have a problem:
> >>>> In my application I'm using HttpSessionListener to manage sessions.
> >>>> Here is the class:
>
> >>>> package com.sergiyarendar.listeners;
>
> >>>> import java.util.logging.Logger;
> >>>> import javax.servlet.http.HttpSessionEvent;
> >>>> import javax.servlet.http.HttpSessionListener;
> >>>> import com.sergiyarendar.services.CounterService;
>
> >>>> public class SessionListener implements HttpSessionListener{
> >>>>        private static final Logger log =
> >>>> Logger.getLogger(SessionListener.class.getName());
> >>>>        private static int sessionNumber;
> >>>>        public void sessionCreated(HttpSessionEvent se){
> >>>>                log.info("Session Created");
> >>>>                sessionNumber = CounterService.getSessionNumber();
> >>>>                sessionNumber++;
> >>>>                CounterService.setSessionNumber(sessionNumber);
> >>>>    }
> >>>>        public void sessionDestroyed(HttpSessionEvent se){
> >>>>                log.info("Session Destroyed");
> >>>>                sessionNumber = CounterService.getSessionNumber();
> >>>>                sessionNumber--;
> >>>>                CounterService.setSessionNumber(sessionNumber);
> >>>>        }
> >>>> }
>
> >>>> This is what I have in web.xml file:
>
> >>>> 
>
> >>>>  com.sergiyarendar.listeners.SessionListener >>>> class>
> >>>> 
>
> >>>> The problem is that public void sessionCreated(HttpSessionEvent se)
> >>>> method is invoked if a new session is created, BUT public void
> >>>> sessionDestroyed(HttpSessionEvent se) method is never invoked. I'm
> >>>> setting the timeout for the sessions using setMaxInactiveInterval(120)
> >>>> method when the session begin.
>
> >>>> Can anyone say me what is the problem? Is it a GAE bug, or some thing
> >>>> is wrong with my code? Please, it is very important, becouse whithout
> >>>> sessio

[appengine-java] Re: GAE on Mac OS X not working on local Jetty

2011-03-12 Thread Stefan
Hi guys,

I seem to be running into the same or a similar problem when trying to run a 
GAE app in dev mode on MacOS. Have you looked in your system.log (e.g. using 
Console.app)? I am getting:

Mar 12 12:29:40 Stefans-MacBook java[1407]: [Java CocoaComponent 
compatibility mode]: Enabled
Mar 12 12:29:40 Stefans-MacBook java[1407]: [Java CocoaComponent 
compatibility mode]: Setting timeout for SWT to 0.10
Mar 12 12:29:45 Stefans-MacBook mds[35]: (Warning) Server: No stores 
registered for metascope "kMDQueryScopeComputer"
Mar 12 12:29:45 Stefans-MacBook ReportCrash[1409]: Saved crash report for 
java[1407] version 1.0 (1.0) to 
/Users/Stefan/Library/Logs/DiagnosticReports/java_2011-03-12-122945_Stefans-MacBook.crash

In the crash-report file mentioned above I am seeing the following:

Process: java [1362]
Path:   
 /System/Library/Frameworks/JavaVM.framework/Versions/1.6.0/Home/bin/java
Identifier:  java
Version: 1.0 (1.0)
Code Type:   X86 (Native)
Parent Process:  eclipse [1242]

Date/Time:   2011-03-12 12:15:57.436 +0100
OS Version:  Mac OS X 10.6.6 (10J567)
Report Version:  6

Exception Type:  EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x
Crashed Thread:  10  Dispatch queue: com.apple.root.low-priority

(Followed by a bunch of info about different processes.)

I don't really know what to make of this. I have tried launching the GAE 
devmode using an older JRE-version but this does not help. According to 
Apple the EXC_BAC_ACCESS / KERN_PROTECTION_FAILURE:

 "This is caused by the thread trying to write to read-only memory. This is 
always caused by a data access." [1]

I am running Snow Leopard with the most recent Java Update and the most 
recent GAE SDK.

Anybody else got any thoughts in this?

Stefan


[1] 
http://developer.apple.com/library/mac/#technotes/tn2004/tn2123.html#SECCRASHLOGBASIC

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



[appengine-java] Re: GAE on Mac OS X not working on local Jetty

2011-03-12 Thread Stefan
Just found another thread about this error which seems to have solution for 
this problem (I haven't tried it yet): 

http://code.google.com/intl/de-DE/appengine/forum/java-forum.html?place=topic%2Fgoogle-appengine-java%2FWiImnzVb9Fo%2Fdiscussion

I suggest we continue over there.

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



[appengine-java] Re: URL Fetch java.io.IOException

2011-04-10 Thread Stefan
Hi Thomad and Z,

could one of you describe what you did? Do you simply mean that you
remove this line:

con.setRequestProperty("Content-Length", "" +
Integer.toString(urlParameters.getBytes().length));

For what it's worth: I think this is related to issue 4823 (though the
title seems to suggest it is only concerned with https):

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

Best regards,
Stefan

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



[appengine-java] Re: HTTP POST failing in dev environment with SDK 1.4.3

2011-04-10 Thread Stefan
Could be related to issue 
http://code.google.com/p/googleappengine/issues/detail?id=4823

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



[appengine-java] Re: URL Fetch java.io.IOException

2011-04-10 Thread Stefan
Ok, never mind. I removed the con.setRequestProperty("Content-
Length",...) in the offending code and that solved my problem.
Thanks!

Stefan

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



[appengine-java] Re: why two regsitered caches share same space

2011-04-20 Thread Stefan
Hi Ikai,

could you please elaborate on this. Specifically, how do you use the
namespaces api in a local TESTING environment, i.e. using
LocalServiceTestHelper etc.? (It works fine in production and dev
server.)

When I call NamespaceManager.set("testing") in my test setUp() method,
this results in a NullpointerException in NamespaceManager.set().

Here is my setUp() method:

NamespaceManager.set("testing");
memcacheService = new LocalServiceTestHelper(new
LocalMemcacheServiceTestConfig());
memcacheService.setUp();

Please advice.

Best regards,
Stefan

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



[appengine-java] "java.io.IOException: unexpected response from remote api" when using Remote API to connect to local dev server

2011-12-09 Thread Stefan
Hi everyone,

I am trying to use the Remote API as described in [1] to connect to
the local data store. But when I call the RemoteApiInstaller's
install() method I always get the mentioned exception. Here is the
complete trace:

Exception in thread "main" java.io.IOException: unexpected response
from remote api: {rtok: null, app_id: myID}

at
com.google.appengine.tools.remoteapi.RemoteApiInstaller.getAppIdFromServer(RemoteApiInstaller.java:
319)
at
com.google.appengine.tools.remoteapi.RemoteApiInstaller.loginImpl(RemoteApiInstaller.java:
276)
at
com.google.appengine.tools.remoteapi.RemoteApiInstaller.login(RemoteApiInstaller.java:
237)
at
com.google.appengine.tools.remoteapi.RemoteApiInstaller.install(RemoteApiInstaller.java:
106)
at
util.kisimporter.KisCsvImporter.setupRemoteDatastoreService(KisCsvImporter.java:
290)
at
util.kisimporter.KisCsvImporter.configureUsingLocalDevServer(KisCsvImporter.java:
266)
at util.kisimporter.KisCsvImporter.main(KisCsvImporter.java:106)

Anybody else having this problem? Or better yet: a solution? :)

Best,
Stefan

[1] 
http://code.google.com/appengine/docs/java/tools/remoteapi.html#Configuring_Remote_API_on_the_Client

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



[appengine-java] Re: java application upload help

2011-12-09 Thread Stefan
Hi Prasad,

looks like you have an invalid character in one of the files in your
project:

On Dec 9, 4:20 am, "madushka.prasadgmail.com"
 wrote:
> SEVERE: Invalid character in 
> filename:www.facebook.com_login.php_login_attempts
> =1.php
> Dec 10, 2011 2:45:41 AM
> com.google.appengine.tools.admin.AppVersionUpload addFil
> e
> SEVERE: Invalid character in filename: 
> __static__/www.facebook.com_login.php_log
> in_attempts=1.php

Maybe that is the cause of your problem?

Best,
Stefan

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



[appengine-java] Cron job fired up twice

2009-11-04 Thread Stefan Roman

Hi All,

My crontab is defined in the following way:



  
/cron/sendnotifs
Send notification at 9 every Mon, Tue, Wed, Thu, Fri
every mon,tue,wed,thu,fri 09:00
Europe/Sarajevo
  
  
/cron/sendnotifs
Send notification at 10 every Sat, Sun
every sat,sun 10:00
Europe/Sarajevo
  


The problem is that it is fired up twice. Unfortunately I don't know
how big is the problem because I don't receive notifications every
time when cron hits the /cron/sendnotifs URL, but if the conditions
for notification in my app are met, I receive two notifications. That
leads me to the conclusion that cron was started twice.

Today, cron was executed at 9 as it suppouse to, and at 09:05:09.

Where is the problem? Am I missing something?

Thanks in advance for any help.

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



[appengine-java] Create entity and get ID

2010-10-21 Thread Cosmin Stefan
Hey,

I have encountered a weird case while trying to create a new entity in
the database:

I have this code:

Meeting meeting=new Meeting(...)
pm.makePersistent(meeting);
Long meetingID=meeting.getId();

if(meetingID==null)
throw new Exception("meetingID is null...");

and in the Meeting Class:
/** The id. */
   @PrimaryKey
   @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
   private Long id;
so the id is Long.

The problem is that sometimes the above code throws an exception, some
other times it doesn't... What am I doing wrong?

Thanks!

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



[appengine-java] Re: Create entity and get ID

2010-10-22 Thread Cosmin Stefan
Hey,

Unfortunately, the first solution you suggested does not work and I
don't really need a transaction for what I want.

The thing is that I somehow need to persist the new entity and find
out it's key. How can I do this? Does anybody have an ideea?

Thanks a lot,
Cosmin

On Oct 22, 9:18 am, Ian Marshall  wrote:
> Have you tried replacing
>
>   pm.makePersistent(meeting);
>   Long meetingID=meeting.getId();
>
> with
>
>   meeting = pm.makePersistent(meeting);
>   Long meetingID=meeting.getId();
>
> and see if this solves your problem. You might also want to commit
> your transaction if you are doing this persistence in a transaction
> before testing your meeting's ID (the ID might not get allocated until
> transaction committal).
>
> On Oct 20, 11:19 pm, Cosmin Stefan 
> wrote:
>
> > Hey,
>
> > I have encountered a weird case while trying to create a new entity in
> > the database:
>
> > I have this code:
>
> >         Meeting meeting=new Meeting(...)
> >         pm.makePersistent(meeting);
> >         Long meetingID=meeting.getId();
>
> >         if(meetingID==null)
> >                 throw new Exception("meetingID is null...");
>
> > and in the Meeting Class:
> >         /** The id. */
> >       �...@primarykey
> >       �...@persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
> >        private Long id;
> > so the id is Long.
>
> > The problem is that sometimes the above code throws an exception, some
> > other times it doesn't... What am I doing wrong?
>
> > Thanks!

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



[appengine-java] Re: Create entity and get ID

2010-10-22 Thread Cosmin Stefan
And I really want to emphasize that this doesn't happen EVERY time.

Thanks and sorry for replying again!

On Oct 23, 1:17 am, Cosmin Stefan 
wrote:
> Hey,
>
> Unfortunately, the first solution you suggested does not work and I
> don't really need a transaction for what I want.
>
> The thing is that I somehow need to persist the new entity and find
> out it's key. How can I do this? Does anybody have an ideea?
>
> Thanks a lot,
> Cosmin
>
> On Oct 22, 9:18 am, Ian Marshall  wrote:
>
> > Have you tried replacing
>
> >   pm.makePersistent(meeting);
> >   Long meetingID=meeting.getId();
>
> > with
>
> >   meeting = pm.makePersistent(meeting);
> >   Long meetingID=meeting.getId();
>
> > and see if this solves your problem. You might also want to commit
> > your transaction if you are doing this persistence in a transaction
> > before testing your meeting's ID (the ID might not get allocated until
> > transaction committal).
>
> > On Oct 20, 11:19 pm, Cosmin Stefan 
> > wrote:
>
> > > Hey,
>
> > > I have encountered a weird case while trying to create a new entity in
> > > the database:
>
> > > I have this code:
>
> > >         Meeting meeting=new Meeting(...)
> > >         pm.makePersistent(meeting);
> > >         Long meetingID=meeting.getId();
>
> > >         if(meetingID==null)
> > >                 throw new Exception("meetingID is null...");
>
> > > and in the Meeting Class:
> > >         /** The id. */
> > >       �...@primarykey
> > >       �...@persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
> > >        private Long id;
> > > so the id is Long.
>
> > > The problem is that sometimes the above code throws an exception, some
> > > other times it doesn't... What am I doing wrong?
>
> > > Thanks!

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



[appengine-java] Re: Create entity and get ID

2010-10-25 Thread Cosmin Stefan
Hey,

The thing is I don't have a transaction. And, I also am using
IdentityType.Datastore, as I need the id to be generated by the
datastore.

Anyway, this is what I currently have (and doesn't properly work):

@PersistenceCapable(detachable="true")
@Embeddable
public class GMeeting
{
...
/** The id. */
@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Long id;
...}

and the using code:
{

 meeting=new Meeting();
//Adding the new meeting
pm.makePersistent(meeting);
meeting=pm.detachCopy(meeting);
Long meetingID=meeting.getId();
}

Anyway, this still doesn't work. Do I need to use a transaction?

Thanks,
Cosmin


On Oct 23, 2:09 am, "A. Stevko"  wrote:
> In order to make the object accessible after the commit() you need to make
> it detatchable.
>
> @PersistenceCapable(identityType = IdentityType.APPLICATION,
> detachable="true")
> public class Meeting
>
> Then used this...
> pm.makePersistent(meeting);
> Long meetingID=meeting.getId();
>
> On Fri, Oct 22, 2010 at 3:19 PM, Cosmin Stefan <
>
> cosmin.stefandob...@gmail.com> wrote:
> > And I really want to emphasize that this doesn't happen EVERY time.
>
> > Thanks and sorry for replying again!
>
> > On Oct 23, 1:17 am, Cosmin Stefan 
> > wrote:
> > > Hey,
>
> > > Unfortunately, the first solution you suggested does not work and I
> > > don't really need a transaction for what I want.
>
> > > The thing is that I somehow need to persist the new entity and find
> > > out it's key. How can I do this? Does anybody have an ideea?
>
> > > Thanks a lot,
> > > Cosmin
>
> > > On Oct 22, 9:18 am, Ian Marshall  wrote:
>
> > > > Have you tried replacing
>
> > > >   pm.makePersistent(meeting);
> > > >   Long meetingID=meeting.getId();
>
> > > > with
>
> > > >   meeting = pm.makePersistent(meeting);
> > > >   Long meetingID=meeting.getId();
>
> > > > and see if this solves your problem. You might also want to commit
> > > > your transaction if you are doing this persistence in a transaction
> > > > before testing your meeting's ID (the ID might not get allocated until
> > > > transaction committal).
>
> > > > On Oct 20, 11:19 pm, Cosmin Stefan 
> > > > wrote:
>
> > > > > Hey,
>
> > > > > I have encountered a weird case while trying to create a new entity
> > in
> > > > > the database:
>
> > > > > I have this code:
>
> > > > >         Meeting meeting=new Meeting(...)
> > > > >         pm.makePersistent(meeting);
> > > > >         Long meetingID=meeting.getId();
>
> > > > >         if(meetingID==null)
> > > > >                 throw new Exception("meetingID is null...");
>
> > > > > and in the Meeting Class:
> > > > >         /** The id. */
> > > > >       �...@primarykey
> > > > >       �...@persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
> > > > >        private Long id;
> > > > > so the id is Long.
>
> > > > > The problem is that sometimes the above code throws an exception,
> > some
> > > > > other times it doesn't... What am I doing wrong?
>
> > > > > Thanks!
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Google App Engine for Java" group.
> > To post to this group, send email to
> > google-appengine-j...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > google-appengine-java+unsubscr...@googlegroups.com
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/google-appengine-java?hl=en.

-- 
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: Create entity and get ID

2011-02-10 Thread Cosmin Stefan
Hey guys,

Well I still haven't figured this out until now. I get the error from
time to time and it's very odd. Also, now I've started to get a weird
error while trying to GET data from the server:

(javax.jdo.JDOFatalUserException): Error in meta-data for
friendfinder.gserver.GMeeting: No primary key defined.

while trying to access a Meeting entry from the DB.

To repeat myself, the problem is that: In JDO, after I persist an
object to the DB, I want to use it's newly created ID field to create
a many-to-many relationship. Even though I called pm.refresh() and
pm.retrieve() to try and update the info, it crashes. The weird thing
is that, even though it crashes after I've "persisted" the object
(while trying to access one of its fiels), the change doesnt appear in
the datastore. I am NOT using TRANSACTIONS (I tried even with them-
same result).

Could it be because I'm using Long field for ID and not Key?

Thanks!

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



[appengine-java] Collection object not being updated

2011-02-25 Thread Cosmin Stefan
Hey,

I have an issue while trying to update one object in a collection,
using JDO.

Here are the facts:
   o i have a class (let's call it BigClass), that has an embedded
class(SmallClass) containing an ArrayList.
   o I DONT use/need a transaction
   o I query the database to get a List of BigClass items that should
be modified. I iterate through each of them and I...
   o I remove an element from the list in the SmallClass embedded in
the current BigClass, the changes are not ALWAYS persisted
   o if I print (log) the object after the change, it looks modified,
but if i check the DataViewer, the object was not updated
   o i even tried using JDOHelper.makeDirty on the BigClass, with the
fieldName SmallClass, and it still doesn't work.

Some relevant code:

Query q = 
pm.newQuery(BigClass.class,"id==:ids");
List 
participatingUsers=(List)
q.execute(participantIDs);

//Update the participants
ListIterator 
it=participatingUsers.listIterator();
BigClass participant;
boolean modified;
while(it.hasNext())
{
participant=it.next();
participant.list.remove(smth);
 
JDOHelper.makeDirty(participant,"collection");
   }
   
   modify other objects
   
   pm.close()

Another thing is that some of the changes I make after this part are
persisted...

So, if you have any suggestions, shoot pls!

Cosmin

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



[appengine-java] Re: Collection object not being updated

2011-02-28 Thread Cosmin Stefan
So no ideea anyone?

On Feb 25, 11:42 pm, Cosmin Stefan 
wrote:
> Hey,
>
> I have an issue while trying to update one object in a collection,
> using JDO.
>
> Here are the facts:
>    o i have a class (let's call it BigClass), that has an embedded
> class(SmallClass) containing an ArrayList.
>    o I DONT use/need a transaction
>    o I query the database to get a List of BigClass items that should
> be modified. I iterate through each of them and I...
>    o I remove an element from the list in the SmallClass embedded in
> the current BigClass, the changes are not ALWAYS persisted
>    o if I print (log) the object after the change, it looks modified,
> but if i check the DataViewer, the object was not updated
>    o i even tried using JDOHelper.makeDirty on the BigClass, with the
> fieldName SmallClass, and it still doesn't work.
>
> Some relevant code:
>
>                                 Query q = 
> pm.newQuery(BigClass.class,"id==:ids");
>                                 List 
> participatingUsers=(List)
> q.execute(participantIDs);
>
>                                 //Update the participants
>                                 ListIterator 
> it=participatingUsers.listIterator();
>                                 BigClass participant;
>                                 boolean modified;
>                                 while(it.hasNext())
>                                 {
>                                         participant=it.next();
>                                         participant.list.remove(smth);
>
> JDOHelper.makeDirty(participant,"collection");
>                                }
>                                
>                                modify other objects
>                                
>                                pm.close()
>
> Another thing is that some of the changes I make after this part are
> persisted...
>
> So, if you have any suggestions, shoot pls!
>
> Cosmin

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



[appengine-java] Re: Collection object not being updated

2011-03-06 Thread Cosmin Stefan
Hey,

I cannot use a transaction as I need to change multiple entries (as u
see, for each BigClass participant i have to remove an object from the
collection).

Regarding the pm.makePersistent() call, I have tried with it before
and it didn't do anything different. Plus that on the GAE
documentation page they say it's not needed, as the pm tracks all the
changes.

I have discovered another thing related to this problem. As I've shown
you, in the same persistence call I try to do these (remove smth from
the collection) changes and I also modify other objects. The weird
fact is that the last changes I make are persisted, while the others
aren't. Why is that?

Regarding JPA I'll look into it, but it's kind of difficult as I
already have a huge part of my code written with JDO.

Anyway, looking forward to hearing new suggestions!

Thanks,
Cosmin

On Mar 1, 6:59 pm, Ian Marshall  wrote:
> Hi Cosmin,
>
> I do not see any calls to
>
>   pm.makePersistent(...);
>
> I use this to persist newly-created persistent instances.
>
> I know that you do not use transactions, but I do. Within an active
> transaction, one can update persistent instances and even persist or
> delete entity group child instances without calling
>
>   pm.makePersistent(...);
>
> Have you looked at the GAE persistence blog of Max Ross of Google?
> There are some excellent working examples there...
>
> Ian
>
> On Feb 28, 6:55 pm, Cosmin Stefan 
> wrote:
>
> > So no ideea anyone?
>
> > On Feb 25, 11:42 pm, Cosmin Stefan 
> > wrote:
>
> > > Hey,
>
> > > I have an issue while trying to update one object in a collection,
> > > using JDO.
>
> > > Here are the facts:
> > >    o i have a class (let's call it BigClass), that has an embedded
> > > class(SmallClass) containing an ArrayList.
> > >    o I DONT use/need a transaction
> > >    o I query the database to get a List of BigClass items that should
> > > be modified. I iterate through each of them and I...
> > >    o I remove an element from the list in the SmallClass embedded in
> > > the current BigClass, the changes are not ALWAYS persisted
> > >    o if I print (log) the object after the change, it looks modified,
> > > but if i check the DataViewer, the object was not updated
> > >    o i even tried using JDOHelper.makeDirty on the BigClass, with the
> > > fieldName SmallClass, and it still doesn't work.
>
> > > Some relevant code:
>
> > >                                 Query q = 
> > > pm.newQuery(BigClass.class,"id==:ids");
> > >                                 List 
> > > participatingUsers=(List)
> > > q.execute(participantIDs);
>
> > >                                 //Update the participants
> > >                                 ListIterator 
> > > it=participatingUsers.listIterator();
> > >                                 BigClass participant;
> > >                                 boolean modified;
> > >                                 while(it.hasNext())
> > >                                 {
> > >                                         participant=it.next();
> > >                                         participant.list.remove(smth);
>
> > > JDOHelper.makeDirty(participant,"collection");
> > >                                }
> > >                                
> > >                                modify other objects
> > >                                
> > >                                pm.close()
>
> > > Another thing is that some of the changes I make after this part are
> > > persisted...
>
> > > So, if you have any suggestions, shoot pls!
>
> > > Cosmin

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



[appengine-java] Re: Collection object not being updated

2011-03-18 Thread Cosmin Stefan
I still haven't figured this one out. Am I doing something wrong or
there's a small bug in the JDO GAE implementation?

Btw, I saw all the documentation has been changed to LowLevelAPI. Will
JDO loose support sometimes soon?

Thanks,
Cosmin

On Mar 6, 5:07 pm, Cosmin Stefan 
wrote:
> Hey,
>
> I cannot use a transaction as I need to change multiple entries (as u
> see, for each BigClass participant i have to remove an object from the
> collection).
>
> Regarding the pm.makePersistent() call, I have tried with it before
> and it didn't do anything different. Plus that on the GAE
> documentation page they say it's not needed, as the pm tracks all the
> changes.
>
> I have discovered another thing related to this problem. As I've shown
> you, in the same persistence call I try to do these (remove smth from
> the collection) changes and I also modify other objects. The weird
> fact is that the last changes I make are persisted, while the others
> aren't. Why is that?
>
> Regarding JPA I'll look into it, but it's kind of difficult as I
> already have a huge part of my code written with JDO.
>
> Anyway, looking forward to hearing new suggestions!
>
> Thanks,
> Cosmin
>
> On Mar 1, 6:59 pm, Ian Marshall  wrote:
>
> > Hi Cosmin,
>
> > I do not see any calls to
>
> >   pm.makePersistent(...);
>
> > I use this to persist newly-created persistent instances.
>
> > I know that you do not use transactions, but I do. Within an active
> > transaction, one can update persistent instances and even persist or
> > delete entity group child instances without calling
>
> >   pm.makePersistent(...);
>
> > Have you looked at the GAE persistence blog of Max Ross of Google?
> > There are some excellent working examples there...
>
> > Ian
>
> > On Feb 28, 6:55 pm, Cosmin Stefan 
> > wrote:
>
> > > So no ideea anyone?
>
> > > On Feb 25, 11:42 pm, Cosmin Stefan 
> > > wrote:
>
> > > > Hey,
>
> > > > I have an issue while trying to update one object in a collection,
> > > > using JDO.
>
> > > > Here are the facts:
> > > >    o i have a class (let's call it BigClass), that has an embedded
> > > > class(SmallClass) containing an ArrayList.
> > > >    o I DONT use/need a transaction
> > > >    o I query the database to get a List of BigClass items that should
> > > > be modified. I iterate through each of them and I...
> > > >    o I remove an element from the list in the SmallClass embedded in
> > > > the current BigClass, the changes are not ALWAYS persisted
> > > >    o if I print (log) the object after the change, it looks modified,
> > > > but if i check the DataViewer, the object was not updated
> > > >    o i even tried using JDOHelper.makeDirty on the BigClass, with the
> > > > fieldName SmallClass, and it still doesn't work.
>
> > > > Some relevant code:
>
> > > >                                 Query q = 
> > > > pm.newQuery(BigClass.class,"id==:ids");
> > > >                                 List 
> > > > participatingUsers=(List)
> > > > q.execute(participantIDs);
>
> > > >                                 //Update the participants
> > > >                                 ListIterator 
> > > > it=participatingUsers.listIterator();
> > > >                                 BigClass participant;
> > > >                                 boolean modified;
> > > >                                 while(it.hasNext())
> > > >                                 {
> > > >                                         participant=it.next();
> > > >                                         participant.list.remove(smth);
>
> > > > JDOHelper.makeDirty(participant,"collection");
> > > >                                }
> > > >                                
> > > >                                modify other objects
> > > >                                
> > > >                                pm.close()
>
> > > > Another thing is that some of the changes I make after this part are
> > > > persisted...
>
> > > > So, if you have any suggestions, shoot pls!
>
> > > > Cosmin

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



[appengine-java] logs: Column-Description, URL-Parameter in POST-Request

2011-05-02 Thread Stefan Krecher


Hi,

developing a facebook-app hosted on gae, i encounter the following kind of 
log-entry (app-name/ ip obscured):

1.2.3.4 - - [02/May/2011:00:14:10 -0700] "POST /myapp/name HTTP/1.1" 200 188 
"http://myapp.appspot.com/name.html?bla&auth_token=e79cca5370383a89deaeca05a8cc3e23";
 "Mozilla/5.0 (Windows; U; Windows NT 6.1; de; rv:1.9.2.12) Gecko/20101026 
Firefox/3.6.12,gzip(gfe)" "myapp.appspot.com" ms=22 cpu_ms=23 api_cpu_ms=0 
cpm_usd=0.000772

In the application i want to read the URL-Parameter "auth_token", but when i 
try to get i from the request, p.e:

_request.getQueryString()

_request.getRequestURL()

_request.getRequestURI()

_request.getAttributeNames()

_request.getParameterMap()

... it is not there! The content-InputStream of that request seems to be empty 
too. But in the log-entry i can see the parameter.

I know that URL-Parameters are used in GET-Requests and here i have a 
POST-Request - might that be the problem? But the parameter "auth_token" is 
logged, so i should be able to access it somehow ...

regards,

Stefan

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



[appengine-java] Scripting disabled? Does not work after SDK-update to 1.5

2011-05-12 Thread Stefan Krecher
Hi,
creating a ScriptEngine in a servlet like this:
ScriptEngineManager factory = new ScriptEngineManager();
ScriptEngine engine = factory.getEngineByExtension("js");

(or using the String "JavaScript" instead of "js")
does not work, engine is null.

doing: logger.warning("num engines=" + factory.getEngineFactories().size());
displays: 0

This worked yesterday, still works in development mode (on jetty) but does 
not work when i deploy to app engine.
Any explanation? Do i need to configure the usage of scripting somehow?
Thanks,
Stefan Krecher

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



[appengine-java] examples or best practices for backends

2011-06-06 Thread Stefan Krecher
Hi,
i'm interested in using backends for long running processes but i did not 
find any real-world example of using backends.
Configuration works fine, backends-api for examination of the 
backends-instances seems to be obvious.
Since the serialization of a rhino-scripting engine is not possible at the 
moment - could i use a backend to run the scriptengine and to interact with 
it during a long-term session? How could this be done?
regards,
Stefan

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



[appengine-java] Aw: examples or best practices for backends

2011-06-14 Thread Stefan Krecher
ok, after all, here is an example i did on my own: my JTalk Server Project 
(Smalltalk on top of Javascript - on top of GAE) is now using backends.
Blogpost: http://krecher.com/2011/06/jtalk-server-now-using-backends-on.html
Source: http://code.google.com/p/jtalk-server/
regards,
Stefan

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