Re: [appengine-java] Re: jdo and pm.close()?

2010-07-12 Thread Andrés Cerezo
Yes I'm agree with all the comments, but my problem is that I have to read
data after saving and I can only see these data after doing a pm.close().
Anyone has a simple project? I'm really lost and I'm losing a lot of time in
this


2010/7/12 boustanihani 

> Not the Manager is created once but the ManagerFactory!
> Managers should be created and ended each time data-access is needed!
>
> I think you should call pm.commit() after calling makePersistent() ...
> because after that u r sure that your data has been written!
> I would be glad to hear your feedback.
>
> regards
> Hani
>
> On Jul 12, 6:45 am, Ronmell Fuentes  wrote:
> > Hi Andres.
> > when you build a PersistenceManager, the instance must be done just once
> > during the call in your method, class, etc., so, if you want to continue
> > with doing more tasks with it, it's ok. just when the call to your
> manager
> > class is ended then you can delete or end the manager, otherwise you can
> > keep using it. Remember the process of building the manager is done just
> > once in your whole app, but the instances can be many.
> >
> > Rgds.
> >
> > R
> >
> > 2010/7/11 Andrés Cerezo 
> >
> >
> >
> >
> >
> > > If i want to execute this source code without errors, I have to delete
> the
> > > first pm.close(); Anyone knows why?
> >
> > >   final Date date = new Date();
> > > EmployeeData employee = new  EmployeeData("John", "Doe", date);
> >
> > >   PersistenceManager pm = PMF.get().getPersistenceManager();
> >
> > >   final Long id = pm.makePersistent(employee).getId();
> >
> > >   // From a different persistence manager, look up the //
> object
> >
> > >   employee = pm.getObjectById(EmployeeData.class, id);
> > >   assertEquals(employee.getFirstName(), "John");
> > >   assertEquals(employee.getLastName(), "Doe");
> >
> > >   pm.close();
> >
> > >  pm = PMF.get().getPersistenceManager(); */
> >
> > >   EmployeeData employee2 = new EmployeeData("John2", "Doe2",
> date);
> >
> > >   final Long id2 = pm.makePersistent(employee2).getId();
> >
> > >   // From a different persistence manager, look up the //
> object
> >
> > >   employee2 = pm.getObjectById(EmployeeData.class, id2);
> > >   assertEquals(employee2.getFirstName(), "John");
> > >   assertEquals(employee2.getLastName(), "Doe");
> >
> > >   pm.close();
> >
> > > 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 unsubscr...@googlegroups.com>
> > > .
> > > For more options, visit this group at
> > >http://groups.google.com/group/google-appengine-java?hl=en.
> >
> > --
> > ausencia de evidencia  ≠  evidencia de ausenciahttp://
> culturainteractiva.blogspot.com/
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-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: Sending mail in transaction

2010-07-12 Thread dflorey
You could add an app engine mail account as bcc and skip the task when
you receive that email to avoid duplicate execution ;-)

On 12 Jul., 00:30, Marcus Brody  wrote:
> I know :( I just thought there maybe be some trick with special case :
> Sending Mail.
> Good is it forces to think :)
>
> On Jul 11, 11:57 pm, dflorey  wrote:
>
>
>
> > AFAIK there is no (simple) way to turn requests with undefined result
> > into idempotent tasks. I've been struggling to execute gdata insert
> > requests in a transaction as they may return with a timeout.
> > It would be very nice if google would provide the standard services in
> > an idempotent manner.
>
> > On 10 Jul., 18:43, Marcus Brody  wrote:
>
> > > Hello,
>
> > > I would like to ask, if there is some way how to send mail only in
> > > case that some db transaction will be successful.
> > > I am not very experienced with gae, but I did study it now for about 2
> > > weeks.
>
> > > Desired output:
>
> > >           1) prepare email
> > >           2) db transaction.begin()
> > >           3) do some db operation
> > >           4) bind sending mail with current transaction (similar to
> > > how can you can attach Task to queue)
> > >           5) db transaction.commit()
>
> > > I am aware that I can queue mail sending task to task queue, but i
> > > cannot find the way how to do that mail sending task Idempotent
> > > without (i think) complicated locking mechanism .
> > > Most simple solution would be to put mail sending task to task queue,
> > > but this means mail could be send twice in some rare situation. (this
> > > is maybe not that bad but if there is some way how to avoid it, I
> > > would like to know)
>
> > > Thank you,
>
> > > Marcus

-- 
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: Task Queues and other services in jetty

2010-07-12 Thread Miroslav Genov
I got it working. It seems that LocalTaskQueueTestConfig has a property 
disableAutoTaskExecution. Here is the snippet that fixes my issue:


LocalTaskQueueTestConfig taskQueueConfig = new LocalTaskQueueTestConfig();
taskQueueConfig.setDisableAutoTaskExecution(false);

Regards,
  Miroslav

On 07/12/2010 09:03 AM, Miroslav Genov wrote:

Any ideas ?

Regards,
  Miroslav


On 07/10/2010 08:36 PM, Miroslav Genov wrote:

Hello,
My general idea of doing this in jetty instead of GAE's local 
development server is that I want to spin up the development server 
from my test. To handle that, I made a custom ApiProxy.Delegate that 
could be cleared after test finishes it's execution.


The issue that I'm encountering is that I cannot test task queue 
execution from my tests. I suppose that GAE development server is 
registering it's own servlets and filters that are simulating gae 
services locally - task queues, datastore, memcache and etc. My 
problems is that I don't know which ones are they. It seems that 
appengine-local-runtime.jar contains a webdefault.xml file which 
contains all registered servlets and filters, but I don't know 
whether they are for the service emulation or they are for the 
administrative interface only. Can anyone give me a clue about this ?


Here is a small snippet from my code, that is illustrating what I'm 
doing:

server = new Server(port);
Context root = new Context(server, "/", Context.SESSIONS);
root.setResourceBase("web");

// we have to attach a gae emulation filter that is installing
// all required local services.
root.addFilter(new FilterHolder(new Filter() {

 MyAppLocalServiceTestHelper helper = new 
EvoAdmLocalServiceTestHelper();

  //init and destroy definitions are empty
  .
  public void doFilter(ServletRequest servletRequest, ServletResponse 
servletResponse, FilterChain filterChain) throws IOException, 
ServletException {

  // GAE  local services setup
   // Initializes a custom datastore Delegate which may clean 
it's state after the test was executed.

  helper.setUp();
  filterChain.doFilter(servletRequest, servletResponse);
  }

   }),"/*",0);

root.addFilter(GuiceFilter.class, "/*", 0);
root.addServlet(DefaultServlet.class, "/");




Regards,
   Miroslav





--
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] times out - while creating too many entities

2010-07-12 Thread aswath satrasala
Hello,
I have situation where I am creating atleast 100 entities in one request.
All the 100 entities has the same parent.
The appengine times out with DeadlineExceeded exception.

Any suggestions on how to avoid the DeadlineExceeded exception.

-Aswath

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



[appengine-java] Testing a remoteService that execute datastore operations

2010-07-12 Thread poe
Hi everyone,

i want to test a remoteService that performs operations on a datastore
with jdo. For example:

public class UserServiceImpl extends RemoteServiceServlet implements
UserService {

  public User addUser(User u) {
PersistenceManager pm = PMF.get().getPersistenceManager();
try {
  pm.makePersistent(u);
} finally {
  pm.close();
}
return u;

  };
  public User updateUser(User u) {
...
  }
  ...
}

how can i implement a test case, that tests the listed operations, so
that the datastore operations didn't effect my development datastore
(maybe does some memcache operations or so?). I hope you get what i
mean :-) tell me if you need more information.

Thanks and greetings,
Poe

-- 
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] Testing a remoteService that execute datastore operations

2010-07-12 Thread Miroslav Genov

Hello,
  You have to use the LocalServiceTestHelper class to manage 
datastore,memcache, task queues and etc.


Here is one example that could help you find out how to use it:

class UserServiceImplTest  extends TestCase {
  private  LocalServiceTestHelper helper = new LocalServiceTestHelper(
  new LocalDatastoreServiceTestConfig(),
  new LocalMemcacheServiceTestConfig(),
  new LocalURLFetchServiceTestConfig());

  @Override
  public void setUp() {
 helper.setUp();
  }

  @Override
  protected void tearDown() throws Exception {
helper.tearDown();
  }

  public void testAddsNewUser() {
User user = new User("test","test");
new UserServiceImpl().addUser(user);
assertUserExists(user);
  }
   .
}

Please note that there is an excellent presentation about testing from 
google io and you can check it out at: 
http://code.google.com/events/io/2010/sessions/testing-techniques-app-engine.html


Regards,
  Miroslav

On 07/12/2010 01:08 PM, poe wrote:

Hi everyone,

i want to test a remoteService that performs operations on a datastore
with jdo. For example:

public class UserServiceImpl extends RemoteServiceServlet implements
UserService {

   public User addUser(User u) {
 PersistenceManager pm = PMF.get().getPersistenceManager();
 try {
   pm.makePersistent(u);
 } finally {
   pm.close();
 }
 return u;

   };
   public User updateUser(User u) {
 ...
   }
   ...
}

how can i implement a test case, that tests the listed operations, so
that the datastore operations didn't effect my development datastore
(maybe does some memcache operations or so?). I hope you get what i
mean :-) tell me if you need more information.

Thanks and greetings,
Poe

   


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



[appengine-java] Re: jdo and pm.close()?

2010-07-12 Thread boustanihani
You can't agree with all the comments because there are
contradictions. It is possible to agree with some of them but not all
of them!

Did u try calling pm.commit() after calling makePersistent() ?

-- 
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 and pm.close()?

2010-07-12 Thread Andrés Cerezo
Sorry, I would to say that I understand both comments because I've test all
the posible options. Here is my source code, look that I have to comment
pm.close(), to do a number of calls to createUser. Can you help, please?

Thanks.

public UserInfo createUser(String fullname, String address, String city,
String state, String zip) throws DAOException {
UserInfo user = new UserInfo(fullname, address, city, state, zip);
Transaction transaction = null;
PersistenceManager pManager = null;

try {
// Obtain a Persistence Manager from the Factory Object
// pManager = pManagerFactory.getPersistenceManager();

pManager = PersistenceManagerHelper.getPersistenceManager();

// Retrieve a Transaction object from the Persistence Manager
transaction = pManager.currentTransaction();

// Begin a transaction
transaction.begin();

// Persist the object
pManager.makePersistent(user);

// Commit the transaction
transaction.commit();
} catch (Exception e) {
if (transaction != null) {
// Rollback the transaction
transaction.rollback();
}

e.printStackTrace();
} finally {

// Close the Persistence Manager
if (pManager != null) {
// pManager.close();

}
}

return user;
}


Cheers.

Andrés Cerezo.


2010/7/12 boustanihani 

> You can't agree with all the comments because there are
> contradictions. It is possible to agree with some of them but not all
> of them!
>
> Did u try calling pm.commit() after calling makePersistent() ?
>
> --
> 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: jdo and pm.close()?

2010-07-12 Thread boustanihani
Could you paste the source of "PersistenceManagerHelper" ?
Are you sure you are getting a new PersistenceManager ?

-- 
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 and pm.close()?

2010-07-12 Thread Andrés Cerezo
In the documentation I've read that I have to use a singleton instance here
you have the source code, perhaps i have here the error?

public class PersistenceManagerHelper {

  /* the singleton instance */
  private static PersistenceManager instance = null;

  /**
   * Hide the constructor.
   */
  private PersistenceManagerHelper() {
  }

  /**
   * Gets the singleton instance of the PersistenceManager
   *
   * @return the singleton instance of the PersistenceManager
   */
  public static PersistenceManager getPersistenceManager() {
 if (instance == null) {
  instance =
  JDOHelper.getPersistenceManagerFactory("transactions-optional")
  .getPersistenceManager();
  }



return instance;
  }


}

Thanks.


2010/7/12 boustanihani 

> Could you paste the source of "PersistenceManagerHelper" ?
> Are you sure you are getting a new PersistenceManager ?
>
> --
> 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: jdo and pm.close()?

2010-07-12 Thread boustanihani
Yes indeed, here is the error ... the PersistenceManagerFactory should
be the singleton not the PersistenceManager. Managers should be
created and ended each time data-access is needed!

After u close a PersistenceManager u may not reuse it again ... and
this is what was happening because your PersistenceManagerHelper was
always returning the same instance! Let it always return a new
PersistenceManager and your code will work!

See =>
http://db.apache.org/jdo/api22/apidocs/javax/jdo/PersistenceManager.html#close()

regards
Hani

-- 
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: Have to restart server to see changes when using Spring

2010-07-12 Thread Marcel Overdijk
Anytime you change a Java file you have to restart the server to make
the changes effective.



On Jul 12, 7:59 am, decitrig  wrote:
> I have this controller set up right now, using Spring MVC 3.0:
>
> @Controller
> public class HelloController {
>
>   @RequestMapping("/hello.htm")
>   public String hello() {
>     return "helloView";
>   }
>
> }
>
> It works fine - navigating to that link tries to call up the helloView
> view. However, if I want to make a change (like switching the return
> value to "helloView1") I have to stop and restart the process in
> Eclipse. Making changes to e.g. index.jsp in the war/ directory are
> refreshed just fine. Is there something special I need to do for
> Spring? I'm just getting started with it & with GAE, so I'm probably
> just doing something blinkered. Everything seems to *work* fine, I
> just have to restart for changes to be displayed.
>
> --
> decitrig

-- 
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] GAE JavaMail jumbles UTF-8

2010-07-12 Thread Marc Hacker
On Google App Engine Java email service, I am trying to send a UTF8
(Hebrew) email subject and body but they arrive (in Gmail) jumbled  as
��

Here is my code

MimeMessage msg = new MimeMessage(session);
msg.setSubject(emailSubject, "UTF-8");

Multipart mp = new MimeMultipart();
MimeBodyPart htmlPart = new MimeBodyPart();
htmlPart.setContent(htmlBody, "text/html; charset=UTF-8");
mp.addBodyPart(htmlPart);
msg.setContent(mp);
Transport.send(msg);

I noticed that my browser is treating the email when viewed in Gmail
us Unicode UTF8 so that isn't the problem.

Any ideas please?

Marc

-- 
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] How to query a __key__ in Datastore Viewer

2010-07-12 Thread cse.zh...@gmail.com
Dear all,
How Can I query a __key__ in Datastore Viewer?

I tried the following method:
SELECT * FROM PreparedTransaction WHERE
name='0cc230c8611ce1a9fcd2dd131c27'

SELECT * FROM PreparedTransaction WHERE
__key__='agdwYXllbGV4cjkLEhNQcmVwYXJlZFRyYW5zYWN0aW9uIiAwMDAwMGNjMjMwYzg2MTFjZTFhOWZjZDJkZDEzMWMyNww'

All these failed.

Is there any way to achieve this?

I am looking this forum and google for hours, but can't find any clue.

Best regards,

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



Re: [appengine-java] Re: Have to restart server to see changes when using Spring

2010-07-12 Thread John Patterson
JRebel woks well with App Engine to make restarting unnecessary most  
of the time.


On 12 Jul 2010, at 19:53, Marcel Overdijk wrote:


Anytime you change a Java file you have to restart the server to make
the changes effective.



On Jul 12, 7:59 am, decitrig  wrote:

I have this controller set up right now, using Spring MVC 3.0:

@Controller
public class HelloController {

  @RequestMapping("/hello.htm")
  public String hello() {
return "helloView";
  }

}

It works fine - navigating to that link tries to call up the  
helloView

view. However, if I want to make a change (like switching the return
value to "helloView1") I have to stop and restart the process in
Eclipse. Making changes to e.g. index.jsp in the war/ directory are
refreshed just fine. Is there something special I need to do for
Spring? I'm just getting started with it & with GAE, so I'm probably
just doing something blinkered. Everything seems to *work* fine, I
just have to restart for changes to be displayed.

--
decitrig


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




--
You received this message because you are subscribed to the Google Groups "Google 
App Engine for Java" group.
To post to this group, send email to google-appengine-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: Have to restart server to see changes when using Spring

2010-07-12 Thread decitrig
On Jul 12, 5:53 am, Marcel Overdijk  wrote:
> Anytime you change a Java file you have to restart the server to make
> the changes effective.

My mistake; I'm also working with GWT, and got the two mixed up. Sorry
for the static!

> On Jul 12, 7:59 am, decitrig  wrote:
>
>
>
> > I have this controller set up right now, using Spring MVC 3.0:
>
> > @Controller
> > public class HelloController {
>
> >   @RequestMapping("/hello.htm")
> >   public String hello() {
> >     return "helloView";
> >   }
>
> > }
>
> > It works fine - navigating to that link tries to call up the helloView
> > view. However, if I want to make a change (like switching the return
> > value to "helloView1") I have to stop and restart the process in
> > Eclipse. Making changes to e.g. index.jsp in the war/ directory are
> > refreshed just fine. Is there something special I need to do for
> > Spring? I'm just getting started with it & with GAE, so I'm probably
> > just doing something blinkered. Everything seems to *work* fine, I
> > just have to restart for changes to be displayed.
>
> > --
> > decitrig

-- 
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 and pm.close()?

2010-07-12 Thread Hariharan Anantharaman
Even i was having the single instance of PersistenceManager in my
application. I too had the code similar to the above mentioned way.

In some perspective, the PersistenceManager can be considered similar to
JDBC connection. So by basic programming concepts, i ended up creating only
one(or perhaps at the max a pool of persistence managers). will having many
persistent managers have any undesirable side effects?

Thanks
Hari

2010/7/12 boustanihani 

> Yes indeed, here is the error ... the PersistenceManagerFactory should
> be the singleton not the PersistenceManager. Managers should be
> created and ended each time data-access is needed!
>
> After u close a PersistenceManager u may not reuse it again ... and
> this is what was happening because your PersistenceManagerHelper was
> always returning the same instance! Let it always return a new
> PersistenceManager and your code will work!
>
> See =>
>
> http://db.apache.org/jdo/api22/apidocs/javax/jdo/PersistenceManager.html#close()
>
> regards
> Hani
>
> --
> 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] Download GAE Eclipse plug-in without eclipse

2010-07-12 Thread Rajeev Dayal
http://code.google.com/eclipse/docs/install-from-zip.html

On Fri, Jul 9, 2010 at 12:00 AM, shekhar  wrote:

> Hi,
>
> I do not have internet connection at my home. So I am not able to
> download GAE eclipse plugin at my home. Is it possible to download
> this plugin without using eclipse? Is it available some other format
> like zip,rar ?
>
> --
> 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: generating sequence for persistence classes like Country and so on ...

2010-07-12 Thread Hariharan Anantharaman
Ok. It was my mistake to get your question wrong.  Apologize for the
confusion.

Thanks
Hari

2010/7/12 cscsaba 

> Hello Hariharan,
>
> I need the way, which can instruct the JPA using the xml, flat file
> ids as unique identifier.
> Since I'm not able to use the find() which is rely on the key field.
> With the following JPA annotation generating ids get out of my
> control.
>@Id
>@GeneratedValue(strategy = GenerationType.IDENTITY)
>
> It seems to me my english is not enough to explain what is the point
> in this case or the answer is trivial for others.
>
>
> On júl. 11, 06:30, Hariharan Anantharaman
>  wrote:
> > In my application, instead of flatfile, i used XML to have the key and
> value
> > (again these entries are used for drop down) and i read the values using
> > xPath api's.  Given that the country list is static as said before, i
> guess
> > it should be work fine.
> >
> > Thanks
> > Hari
> >
> > 2010/7/10 cscsaba 
> >
> > > Hello,
> >
> > > I dont know the way of generating sequence 1,2,3 for countries by JPA.
> > > It generates keys which are not agree with country codes.
> > > Sorry, I was not clear enough.
> >
> > > On júl. 9, 09:51, Nacho Coloma  wrote:
> > > > That seems like good advice. For this concrete use case there is a
> > > > country list included with your JDK:
> >
> > > > Locale[] locales = Locale.getAvailableLocales();
> > > > for (Locale locale : locales) {
> > > > countries.add(new Option(locale.getCountry(),
> > > > locale.getDisplayCountry(currentLocale)));
> >
> > > > }
> >
> > > > On Jul 8, 7:11 pm, "Ikai L (Google)"  wrote:
> >
> > > > > Why not just load these from a flatfile and load it into local
> memory?
> > > The
> > > > > number of countries in the world is something that changes very
> > > > > infrequently.
> >
> > > > > On Mon, Jul 5, 2010 at 12:28 PM, cscsaba 
> > > wrote:
> > > > > > Hello,
> >
> > > > > > What is the best practice to generation sequence ids for
> persistence
> > > > > > classes like Country's id (for Country drop down)?
> > > > > > I mean:
> > > > > >   1.Hungary
> > > > > >   2.US
> > > > > >   3.Spain
> >
> > > > > > The well known Toplink annotation help suggest the following.
> >
> > > > > > @SequenceGenerator(name="CUST_SEQ", allocationSize=25)
> > > > > > @GeneratedValue(strategy=SEQUENCE, generator="CUST_SEQ")
> >
> > > > > > But the SEQUENCE strategy is invalid (underlined by Eclipse)
> >
> > > > > > Is there any real world GAE - JPA example with drop downs
> anywhere ?
> > > > > > What is the paved way to persisting classes with sequential ids ?
> >
> > > > > > Thanks in advance.
> >
> > > > > > cscsaba
> >
> > > > > > (Since there many case when we have to upload these entities from
> > > file with
> > > > > > their own ids  - Country, City and many more)
> >
> > > > > >  --
> > > > > > 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
> > > > > Blog:http://googleappengine.blogspot.com
> > > > > Twitter:http://twitter.com/app_engine
> > > > > Reddit:http://www.reddit.com/r/appengine
> >
> > > --
> > > 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.
>
>

-- 
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: Problem persist JDO- one to many

2010-07-12 Thread Hariharan Anantharaman
Hi Lisan,
In the Torneo class, i am not seeing "mappedBy" attribute for @persistent
tage for field

 private List equiposTorneo;

That is required to make this a owned one-many collection. Only then it
might be possible to get collection of Equipo when retrieving Torneo  .

Thanks
Hari

2010/7/12 Prashant 

> you need to create a new method in Torneo which will detach collections
> field. Now you just need to call this function with PersistenceManager as
> argument.
>
> public Torneo devolverTorneo(Long idTorneo) {
>
>  Torneo b = pm.getObjectById(Torneo.class, idTorneo);
>
>b.detachFields(pm);
>b=pm.detachCopy(b);
>pm.close();
>
>  return b;
>  //The method return the object for update
>
> }
>
>
> public class Torneo implements Serializable{
> 
>
> public void detachFields(PersistenceManager pm) {
>
>  pm.detachCopyAll(equiposTorneo);
>
> }
>
> 
> }
>
> --
> Prashant
> www.claymus.com
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-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] dynamically resizing a textarea

2010-07-12 Thread Brandon A
I'm creating textareas in the main java file of my app, and I want to
make them resize themselves as users enter and delete text in them. I
can't figure out how to do this, though. There are solutions online
where you can use javascript in the html file to compare the
offsetHeight and scrollHeight of the textarea and then make the two
heights match each other. However, since my textareas are not static
elements of the page and because I'm doing this with java, I don't
have access to the scrollHeight of the textarea (well, at least I
think I don't), so I can't use that solution. I'm very new to all of
this so there might be something that I'm completely missing. Any
advice would be greatly appreciated...

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] Guestbook and jdoconfig.xml problem

2010-07-12 Thread Adrian
Hi i'm trying to follow http://www.youtube.com/watch?v=P3GT4-m_6RQ
tutorial but i get this error

HTTP ERROR 500
Problem accessing /otraClase. Reason:

INTERNAL_SERVER_ERROR

Caused by:
java.lang.ExceptionInInitializerError
at com.google.guestbook.otraClase.doGet(otraClase.java:21)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:693)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:806)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:
511)
at org.mortbay.jetty.servlet.ServletHandler
$CachedChain.doFilter(ServletHandler.java:1166)
at
com.google.appengine.api.blobstore.dev.ServeBlobFilter.doFilter(ServeBlobFilter.java:
51)
at org.mortbay.jetty.servlet.ServletHandler
$CachedChain.doFilter(ServletHandler.java:1157)
at
com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:
43)
at org.mortbay.jetty.servlet.ServletHandler
$CachedChain.doFilter(ServletHandler.java:1157)
at
com.google.appengine.tools.development.StaticFileFilter.doFilter(StaticFileFilter.java:
122)
at org.mortbay.jetty.servlet.ServletHandler
$CachedChain.doFilter(ServletHandler.java:1157)
at
org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:
388)
at
org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:
216)
at
org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:
182)
at
org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:
765)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:
418)
at
com.google.apphosting.utils.jetty.DevAppEngineWebAppContext.handle(DevAppEngineWebAppContext.java:
70)
at
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:
152)
at com.google.appengine.tools.development.JettyContainerService
$ApiProxyHandler.handle(JettyContainerService.java:349)
at
org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:
152)
at org.mortbay.jetty.Server.handle(Server.java:326)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:
542)
at org.mortbay.jetty.HttpConnection
$RequestHandler.headerComplete(HttpConnection.java:923)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:547)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:212)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
at
org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:
409)
at org.mortbay.thread.QueuedThreadPool
$PoolThread.run(QueuedThreadPool.java:582)
Caused by: javax.jdo.JDOFatalUserException: A property named
javax.jdo.PersistenceManagerFactoryClass must be specified, or a jar
file with a META-INF/services/javax.jdo.PersistenceManagerFactory
entry must be in the classpath, or a property named
javax.jdo.option.PersistenceUnitName must be specified.
NestedThrowables:
javax.jdo.JDOUserException: Has elegido un PMF con nonbre de
"persistence-unit" de "nontransactional-datasource" (pero no existe!)
a has llamado a JDOHelper.getPersistenceManagerFactory con
"nontransactional-datasource" como el nombre de un archivo de
propiedades (que no existe en el CLASSPATH)
at javax.jdo.JDOHelper.getPersistenceManagerFactory(JDOHelper.java:
856)
at javax.jdo.JDOHelper.getPersistenceManagerFactory(JDOHelper.java:
1092)
at javax.jdo.JDOHelper.getPersistenceManagerFactory(JDOHelper.java:
914)
at com.google.guestbook.PMF.(PMF.java:8)
... 28 more
Caused by: javax.jdo.JDOUserException: Has elegido un PMF con nonbre
de "persistence-unit" de "nontransactional-datasource" (pero no
existe!) a has llamado a JDOHelper.getPersistenceManagerFactory con
"nontransactional-datasource" como el nombre de un archivo de
propiedades (que no existe en el CLASSPATH)
at
org.datanucleus.jdo.JDOPersistenceManagerFactory.initialiseProperties(JDOPersistenceManagerFactory.java:
377)
at
org.datanucleus.jdo.JDOPersistenceManagerFactory.(JDOPersistenceManagerFactory.java:
260)
at
org.datanucleus.jdo.JDOPersistenceManagerFactory.getPersistenceManagerFactory(JDOPersistenceManagerFactory.java:
173)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at
com.google.appengine.tools.development.agent.runtime.Runtime.invoke(Runtime.java:
100)
at javax.jdo.JDOHelper$16.run(JDOHelper.java:1956)
at java.security.AccessController.doPrivileged(Native Method)
at javax.jdo.JDOHelper.invoke(JDOHelper.java:1951)
at
javax.jdo.JDOHelper.invokeGetPersistenceManagerFactoryOnImplementation(JDOHelper.java:
1159)
at javax.j

[appengine-java] Datastore and Polymorphic support getObjectByID(Parent.class, childKey)

2010-07-12 Thread Doug Daniels
I'm trying to model a polymorphic relationship in JDO, List
where each GameRound could be either a TextRound or PictureRound.

I've followed the documentation and modeled the association as a
List as described:
http://code.google.com/appengine/docs/java/datastore/relationships.html#Polymorphic_Relationships

// ... imports ...

@PersistenceCapable
public class Chef {
@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Key key;

@Persistent
private Key favoriteRecipe;
}


Here is my Game object:

@PersistenceCapable
public class Game {

@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Key key;

@Persistent
private List rounds = new ArrayList();
...
}


@PersistenceCapable
@Inheritance(strategy = InheritanceStrategy.SUBCLASS_TABLE)
public class GameRound {
...
}


@PersistenceCapable
public class SentenceRound extends GameRound {
@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Key key;

...
}

@PersistenceCapable
public class PictureRound extends GameRound {
@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Key key;
...
}

The trouble is in my Game object I iterate through the rounds and try
to do a persistenceManager.getObjectById(GameRound.class, key) and I
get the following exception:

WARNING: /viewGames.jsp
javax.jdo.JDOFatalUserException: Exception converting SentenceRound(7)
to an internal key.
at
org.datanucleus.store.appengine.jdo.DatastoreJDOPersistenceManager.getObjectById(DatastoreJDOPersistenceManager.java:
68)
at org.apache.jsp.viewGames_jsp._jspService(viewGames_jsp.java:121)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)


What's the proper way to retrieve a polymorphic key relationship (for
example how would you do it in the Appengine Chef example?).

My only other option is to model the relationship as mutually
exclusive properties of the GameRound (and manage that in my
application logic).

@PersistenceCapable
@Inheritance(strategy = InheritanceStrategy.SUBCLASS_TABLE)
public class GameRound {

@PrimaryKey
@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
private Key key;

//Model relationships as optional components because JDO and
Appengine don't support
//Polymorphic relationships well.

@Persistent
private SentenceRound sentenceRound;

@Persistent
private PictureRound pictureRound;

...
}

-- 
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] problem with storing data in datastore

2010-07-12 Thread Akriti Kalra
I am facing a problem with file upload.I have used Apache Commons
servlet file upload for uploading the file. Though the file is getting
uploaded and the data is getting stored on the local server(http://
127.0.0.1:/_ah/admin/datastore) but it is not going to the Google
App Engine datastore.  Can anyone locate the actual problem?

Thank you
Akriti

-- 
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: How to upload primary key as an id instead of name

2010-07-12 Thread Pasha
Could you please post an example. Thank you in advance.

On Jun 30, 1:18 pm, Matthew Blain  wrote:
> The 1.3.5 bulkloader client will allow you to specify a numeric key;
> you must use the Key constructor explicitly to do this, integers will
> still be converted into strings.
>
> On Jun 30, 12:12 am, MANISH DHIMAN  wrote:
>
> > Hi All
> > When I upload data using CSV file on G A E. Primary key is stored
> > there as a name instead of id.
> > Example.
>
> > Format of .yaml is Given below
> > transformers:
> > - kind: City
> >   connector: csv
> >   connector_options:
> >     encoding: utf-8
> >     columns: from_header
> >   property_map:
> >     - property: __key__
> >       external_name: CityId
> >       export_transform: datastore.Key.id
> >     - property: Name
> >       external_name: Name
>
> > Primary key stored there is:
> > ID/Name                   Name
> > name=1                    Delhi
> > name=2                    London
>
> > Due to uploaded data with name=, when I am try to get Key
> > from any Fetched Entities, then Key contains only name value but id
> > value is 0 and also name contains long value as a String instance.
>
> > Is it possible to store primary key(Using CSV while uploading data) in
> > a format given below :
> > ID/Name              Name
> > id=1                    Delhi
> > id=2                    London
>
> > When data is stored with id=, then Key contains id value is
> >  as long instance.

-- 
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] Disappearing functionality after upgrading App Engine/GWT plugins

2010-07-12 Thread ThisSideUp
Hello,

I am running on Ubuntu 8.04 LTS, using Eclipse Galileo. I am new to
the App Engine, GWT, and Eclipse.

Back in April I installed the App Engine and GWT plugins and started
experimenting with a web app project that uses the App Engine & GWT.

Today I was prompted to upgrade the plugins:
- App Engine SDK bundle from 1.3.2 to 1.3.5
- GWT SDK bundle from 2.0.3 to 2.0.4

After doing so, all of the App Engine and GWT buttons and menu options
disappeared from Eclipse, and I can no longer run the web app nor can
I create new web app projects.

I attempted to resolve the problem by removing the 1.3.2 and 2.0.3
versions of the plugins, but now my web app does not compile.

I am familiar with using Maven to update dependencies, but I do not
have Maven installed right now. How do I go about getting my web app
to use the new versions of the libraries, and how do I fix my Eclipse
configuration?

Thanks in advance.

-- 
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] OAUTH for app engine

2010-07-12 Thread compeng4lf
Can the Google Appengine OAUTH API work with other sites?  Meaning can
you use this API to authenticate on different sites e.g. Twitter.

-- 
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] dynamically resizing a textarea

2010-07-12 Thread Ikai L (Google)
You'll need to do this in the client using Javascript. You can't do client
side UI on the server.

If you're using Google Web Toolkit, you may have better luck finding an
answer here: https://groups.google.com/group/Google-Web-Toolkit?pli=1

On Sun, Jul 11, 2010 at 11:24 PM, Brandon A  wrote:

> I'm creating textareas in the main java file of my app, and I want to
> make them resize themselves as users enter and delete text in them. I
> can't figure out how to do this, though. There are solutions online
> where you can use javascript in the html file to compare the
> offsetHeight and scrollHeight of the textarea and then make the two
> heights match each other. However, since my textareas are not static
> elements of the page and because I'm doing this with java, I don't
> have access to the scrollHeight of the textarea (well, at least I
> think I don't), so I can't use that solution. I'm very new to all of
> this so there might be something that I'm completely missing. Any
> advice would be greatly appreciated...
>
> 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.
>
>


-- 
Ikai Lan
Developer Programs Engineer, Google App Engine
Blog: http://googleappengine.blogspot.com
Twitter: http://twitter.com/app_engine
Reddit: http://www.reddit.com/r/appengine

-- 
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] problem with storing data in datastore

2010-07-12 Thread Pieter Coucke
Check the logs or add your own logging to check if the file arrives.
Files are limited to 1 MB in the datastore.  Use the blobstore service for
bigger files and easy (public) uploading.



On Mon, Jul 12, 2010 at 1:35 PM, Akriti Kalra  wrote:

> I am facing a problem with file upload.I have used Apache Commons
> servlet file upload for uploading the file. Though the file is getting
> uploaded and the data is getting stored on the local server(http://
> 127.0.0.1:/_ah/admin/datastore) but it is not going to the Google
> App Engine datastore.  Can anyone locate the actual problem?
>
> Thank you
> Akriti
>
> --
> 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.
>
>


-- 
Pieter Coucke
Onthoo BVBA
http://www.onthoo.com
http://www.koopjeszoeker.be

-- 
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] GAE JavaMail jumbles UTF-8

2010-07-12 Thread Pieter Coucke
I can only confirm I see the same issue when sending e-mail with a German ü
in the subject.  I haven't found a solution yet.


On Mon, Jul 12, 2010 at 3:04 PM, Marc Hacker  wrote:

> On Google App Engine Java email service, I am trying to send a UTF8
> (Hebrew) email subject and body but they arrive (in Gmail) jumbled  as
> ��
>
> Here is my code
>
>MimeMessage msg = new MimeMessage(session);
>msg.setSubject(emailSubject, "UTF-8");
>
>Multipart mp = new MimeMultipart();
>MimeBodyPart htmlPart = new MimeBodyPart();
>htmlPart.setContent(htmlBody, "text/html; charset=UTF-8");
>mp.addBodyPart(htmlPart);
>msg.setContent(mp);
>Transport.send(msg);
>
> I noticed that my browser is treating the email when viewed in Gmail
> us Unicode UTF8 so that isn't the problem.
>
> Any ideas please?
>
> Marc
>
> --
> 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.
>
>


-- 
Pieter Coucke
Onthoo BVBA
http://www.onthoo.com
http://www.koopjeszoeker.be

-- 
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] times out - while creating too many entities

2010-07-12 Thread Pieter Coucke
Split this up in 10 tasks with 10 entities each or check
http://code.google.com/p/gaevfs/source/browse/trunk/src/com/newatlanta/appengine/taskqueue/Deferred.java



On Mon, Jul 12, 2010 at 11:43 AM, aswath satrasala <
aswath.satras...@gmail.com> wrote:

> Hello,
> I have situation where I am creating atleast 100 entities in one request.
> All the 100 entities has the same parent.
> The appengine times out with DeadlineExceeded exception.
>
> Any suggestions on how to avoid the DeadlineExceeded exception.
>
> -Aswath
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-j...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>



-- 
Pieter Coucke
Onthoo BVBA
http://www.onthoo.com
http://www.koopjeszoeker.be

-- 
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] Sending mail in transaction

2010-07-12 Thread Pieter Coucke
Create a task for sending e-mail instead of calling the mailservice
directly.

use this in your task (a task can be part of a transaction)

try{
...
} catch (Throwable thr) {
 log.error(...);
}

and all exceptions will be catched.  I think a task will be re-executed only
if it fails (throws an exception).




On Sat, Jul 10, 2010 at 6:43 PM, Marcus Brody  wrote:

> Hello,
>
> I would like to ask, if there is some way how to send mail only in
> case that some db transaction will be successful.
> I am not very experienced with gae, but I did study it now for about 2
> weeks.
>
> Desired output:
>
>  1) prepare email
>  2) db transaction.begin()
>  3) do some db operation
>  4) bind sending mail with current transaction (similar to
> how can you can attach Task to queue)
>  5) db transaction.commit()
>
> I am aware that I can queue mail sending task to task queue, but i
> cannot find the way how to do that mail sending task Idempotent
> without (i think) complicated locking mechanism .
> Most simple solution would be to put mail sending task to task queue,
> but this means mail could be send twice in some rare situation. (this
> is maybe not that bad but if there is some way how to avoid it, I
> would like to know)
>
> Thank you,
>
> Marcus
>
> --
> 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.
>
>


-- 
Pieter Coucke
Onthoo BVBA
http://www.onthoo.com
http://www.koopjeszoeker.be

-- 
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: Sending mail in transaction

2010-07-12 Thread Marcus Brody
Pieter,

although this looks easy its not that easy, I am aware that I can
queue a mail sending task,
problem is that task has to be idempotent to achiev desired behaviour,

a queue task can be executed for example twice, since those are
specifications
and this would result in sending mail twice,
a naive aproach would be to update some db lock to prevent sending
mail more than 1 time,
but it is not easy, this is much more complicated,
in other words operation is either atomic or it isnt, and without very
precise mechanism you
cannot prove that task will be runned only one.

My own tests proved that due to email quota being reached (task fail
and has be resheduled) some of the mails
has been send twice.

If Mail API would allowed to send mail only in case of some db
transaction success it would be very easy to garant
that mail will be send exactly 1 time. (although if it fails for some
other reasons like recipient not found or so thats whole another
story :)

Basically this can be solved by
1) adding new API for sending mail (dont know if it so easy or whole
problem isnt much much bigger than i think  - distributed
transactions ?)
2) implementing locking mechanism

On Jul 12, 9:13 pm, Pieter Coucke  wrote:
> Create a task for sending e-mail instead of calling the mailservice
> directly.
>
> use this in your task (a task can be part of a transaction)
>
> try{
> ...
>
> } catch (Throwable thr) {
>  log.error(...);
> }
>
> and all exceptions will be catched.  I think a task will be re-executed only
> if it fails (throws an exception).
>
>
>
>
>
>
>
> On Sat, Jul 10, 2010 at 6:43 PM, Marcus Brody  wrote:
> > Hello,
>
> > I would like to ask, if there is some way how to send mail only in
> > case that some db transaction will be successful.
> > I am not very experienced with gae, but I did study it now for about 2
> > weeks.
>
> > Desired output:
>
> >          1) prepare email
> >          2) db transaction.begin()
> >          3) do some db operation
> >          4) bind sending mail with current transaction (similar to
> > how can you can attach Task to queue)
> >          5) db transaction.commit()
>
> > I am aware that I can queue mail sending task to task queue, but i
> > cannot find the way how to do that mail sending task Idempotent
> > without (i think) complicated locking mechanism .
> > Most simple solution would be to put mail sending task to task queue,
> > but this means mail could be send twice in some rare situation. (this
> > is maybe not that bad but if there is some way how to avoid it, I
> > would like to know)
>
> > Thank you,
>
> > Marcus
>
> > --
> > 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.
>
> --
> Pieter Coucke
> Onthoo BVBAhttp://www.onthoo.comhttp://www.koopjeszoeker.be

-- 
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: Sending mail in transaction

2010-07-12 Thread dflorey
Locking will not help.
You may need to be able to pass a unique identifier to the mail api to
prevent sending mails twice (see
http://groups.google.com/group/google-appengine/browse_thread/thread/c64caf9539a45051/00d157921c2fde92)


On 12 Jul., 22:07, Marcus Brody  wrote:
> Pieter,
>
> although this looks easy its not that easy, I am aware that I can
> queue a mail sending task,
> problem is that task has to be idempotent to achiev desired behaviour,
>
> a queue task can be executed for example twice, since those are
> specifications
> and this would result in sending mail twice,
> a naive aproach would be to update some db lock to prevent sending
> mail more than 1 time,
> but it is not easy, this is much more complicated,
> in other words operation is either atomic or it isnt, and without very
> precise mechanism you
> cannot prove that task will be runned only one.
>
> My own tests proved that due to email quota being reached (task fail
> and has be resheduled) some of the mails
> has been send twice.
>
> If Mail API would allowed to send mail only in case of some db
> transaction success it would be very easy to garant
> that mail will be send exactly 1 time. (although if it fails for some
> other reasons like recipient not found or so thats whole another
> story :)
>
> Basically this can be solved by
> 1) adding new API for sending mail (dont know if it so easy or whole
> problem isnt much much bigger than i think  - distributed
> transactions ?)
> 2) implementing locking mechanism
>
> On Jul 12, 9:13 pm, Pieter Coucke  wrote:
>
>
>
> > Create a task for sending e-mail instead of calling the mailservice
> > directly.
>
> > use this in your task (a task can be part of a transaction)
>
> > try{
> > ...
>
> > } catch (Throwable thr) {
> >  log.error(...);
> > }
>
> > and all exceptions will be catched.  I think a task will be re-executed only
> > if it fails (throws an exception).
>
> > On Sat, Jul 10, 2010 at 6:43 PM, Marcus Brody  wrote:
> > > Hello,
>
> > > I would like to ask, if there is some way how to send mail only in
> > > case that some db transaction will be successful.
> > > I am not very experienced with gae, but I did study it now for about 2
> > > weeks.
>
> > > Desired output:
>
> > >          1) prepare email
> > >          2) db transaction.begin()
> > >          3) do some db operation
> > >          4) bind sending mail with current transaction (similar to
> > > how can you can attach Task to queue)
> > >          5) db transaction.commit()
>
> > > I am aware that I can queue mail sending task to task queue, but i
> > > cannot find the way how to do that mail sending task Idempotent
> > > without (i think) complicated locking mechanism .
> > > Most simple solution would be to put mail sending task to task queue,
> > > but this means mail could be send twice in some rare situation. (this
> > > is maybe not that bad but if there is some way how to avoid it, I
> > > would like to know)
>
> > > Thank you,
>
> > > Marcus
>
> > > --
> > > 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.
>
> > --
> > Pieter Coucke
> > Onthoo BVBAhttp://www.onthoo.comhttp://www.koopjeszoeker.be

-- 
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: Sending mail in transaction

2010-07-12 Thread Pieter Coucke
You can check request headers to see if this is a first invocation of a task
(
http://code.google.com/appengine/docs/java/taskqueue/overview.html#Task_Request_Headers),
so you can detect a second invocation of a task.

Maybe if you combine this with specific catch blocks for mail exceptions?



On Mon, Jul 12, 2010 at 10:07 PM, Marcus Brody  wrote:

> Pieter,
>
> although this looks easy its not that easy, I am aware that I can
> queue a mail sending task,
> problem is that task has to be idempotent to achiev desired behaviour,
>
> a queue task can be executed for example twice, since those are
> specifications
> and this would result in sending mail twice,
> a naive aproach would be to update some db lock to prevent sending
> mail more than 1 time,
> but it is not easy, this is much more complicated,
> in other words operation is either atomic or it isnt, and without very
> precise mechanism you
> cannot prove that task will be runned only one.
>
> My own tests proved that due to email quota being reached (task fail
> and has be resheduled) some of the mails
> has been send twice.
>
> If Mail API would allowed to send mail only in case of some db
> transaction success it would be very easy to garant
> that mail will be send exactly 1 time. (although if it fails for some
> other reasons like recipient not found or so thats whole another
> story :)
>
> Basically this can be solved by
> 1) adding new API for sending mail (dont know if it so easy or whole
> problem isnt much much bigger than i think  - distributed
> transactions ?)
> 2) implementing locking mechanism
>
> On Jul 12, 9:13 pm, Pieter Coucke  wrote:
> > Create a task for sending e-mail instead of calling the mailservice
> > directly.
> >
> > use this in your task (a task can be part of a transaction)
> >
> > try{
> > ...
> >
> > } catch (Throwable thr) {
> >  log.error(...);
> > }
> >
> > and all exceptions will be catched.  I think a task will be re-executed
> only
> > if it fails (throws an exception).
> >
> >
> >
> >
> >
> >
> >
> > On Sat, Jul 10, 2010 at 6:43 PM, Marcus Brody 
> wrote:
> > > Hello,
> >
> > > I would like to ask, if there is some way how to send mail only in
> > > case that some db transaction will be successful.
> > > I am not very experienced with gae, but I did study it now for about 2
> > > weeks.
> >
> > > Desired output:
> >
> > >  1) prepare email
> > >  2) db transaction.begin()
> > >  3) do some db operation
> > >  4) bind sending mail with current transaction (similar to
> > > how can you can attach Task to queue)
> > >  5) db transaction.commit()
> >
> > > I am aware that I can queue mail sending task to task queue, but i
> > > cannot find the way how to do that mail sending task Idempotent
> > > without (i think) complicated locking mechanism .
> > > Most simple solution would be to put mail sending task to task queue,
> > > but this means mail could be send twice in some rare situation. (this
> > > is maybe not that bad but if there is some way how to avoid it, I
> > > would like to know)
> >
> > > Thank you,
> >
> > > Marcus
> >
> > > --
> > > 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.
> >
> > --
> > Pieter Coucke
> > Onthoo BVBAhttp://www.onthoo.comhttp://www.koopjeszoeker.be
>
> --
> 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.
>
>


-- 
Pieter Coucke
Onthoo BVBA
http://www.onthoo.com
http://www.koopjeszoeker.be

-- 
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: Sending mail in transaction

2010-07-12 Thread Marcus Brody
dflorey and Pieter,

thank you for the links,
I will look into it asap.

On Jul 12, 10:35 pm, Pieter Coucke  wrote:
> You can check request headers to see if this is a first invocation of a task
> (http://code.google.com/appengine/docs/java/taskqueue/overview.html#Ta...),
> so you can detect a second invocation of a task.
>
> Maybe if you combine this with specific catch blocks for mail exceptions?
>
>
>
> On Mon, Jul 12, 2010 at 10:07 PM, Marcus Brody  wrote:
> > Pieter,
>
> > although this looks easy its not that easy, I am aware that I can
> > queue a mail sending task,
> > problem is that task has to be idempotent to achiev desired behaviour,
>
> > a queue task can be executed for example twice, since those are
> > specifications
> > and this would result in sending mail twice,
> > a naive aproach would be to update some db lock to prevent sending
> > mail more than 1 time,
> > but it is not easy, this is much more complicated,
> > in other words operation is either atomic or it isnt, and without very
> > precise mechanism you
> > cannot prove that task will be runned only one.
>
> > My own tests proved that due to email quota being reached (task fail
> > and has be resheduled) some of the mails
> > has been send twice.
>
> > If Mail API would allowed to send mail only in case of some db
> > transaction success it would be very easy to garant
> > that mail will be send exactly 1 time. (although if it fails for some
> > other reasons like recipient not found or so thats whole another
> > story :)
>
> > Basically this can be solved by
> > 1) adding new API for sending mail (dont know if it so easy or whole
> > problem isnt much much bigger than i think  - distributed
> > transactions ?)
> > 2) implementing locking mechanism
>
> > On Jul 12, 9:13 pm, Pieter Coucke  wrote:
> > > Create a task for sending e-mail instead of calling the mailservice
> > > directly.
>
> > > use this in your task (a task can be part of a transaction)
>
> > > try{
> > > ...
>
> > > } catch (Throwable thr) {
> > >  log.error(...);
> > > }
>
> > > and all exceptions will be catched.  I think a task will be re-executed
> > only
> > > if it fails (throws an exception).
>
> > > On Sat, Jul 10, 2010 at 6:43 PM, Marcus Brody 
> > wrote:
> > > > Hello,
>
> > > > I would like to ask, if there is some way how to send mail only in
> > > > case that some db transaction will be successful.
> > > > I am not very experienced with gae, but I did study it now for about 2
> > > > weeks.
>
> > > > Desired output:
>
> > > >          1) prepare email
> > > >          2) db transaction.begin()
> > > >          3) do some db operation
> > > >          4) bind sending mail with current transaction (similar to
> > > > how can you can attach Task to queue)
> > > >          5) db transaction.commit()
>
> > > > I am aware that I can queue mail sending task to task queue, but i
> > > > cannot find the way how to do that mail sending task Idempotent
> > > > without (i think) complicated locking mechanism .
> > > > Most simple solution would be to put mail sending task to task queue,
> > > > but this means mail could be send twice in some rare situation. (this
> > > > is maybe not that bad but if there is some way how to avoid it, I
> > > > would like to know)
>
> > > > Thank you,
>
> > > > Marcus
>
> > > > --
> > > > 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.
>
> > > --
> > > Pieter Coucke
> > > Onthoo BVBAhttp://www.onthoo.comhttp://www.koopjeszoeker.be
>
> > --
> > 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.
>
> --
> Pieter Coucke
> Onthoo BVBAhttp://www.onthoo.comhttp://www.koopjeszoeker.be

-- 
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] send mail to person + BCC to all admins (strange behaviour)

2010-07-12 Thread Marcus Brody
Hello everyone,

I was trying to send mail to per...@domain.com and in the same mail
BCC to admins (app has 2x admin)
result is that per...@domain.com never receive mail but admins do.
I would like to ask if this is intended behaviour.

My code is following:

InternetAddress [] replyTo = new InternetAddress[1];
replyTo[0] = new
InternetAddress("reply_will_be_set_h...@domain.com");

Message msg = new MimeMessage(session);
msg.setFrom(new
InternetAddress("admin_registered_with_this_app_email_address");
msg.setReplyTo(replyTo);
msg.addRecipient(Message.RecipientType.TO, new
InternetAddress(
   "email_address_of_customer",
   "Dear Customer,"));
msg.addRecipient(Message.RecipientType.BCC,
new InternetAddress("admins"));
msg.setSubject(messageSubject);
msg.setText(messageBody);
Transport.send(msg);

i case i remove BCC for admins, recipient.TO will get mail,
It looks like sending BCC to admins somehows removes
Message.RecipientType.TO, or is it
problem in my code ?

Thank you,

Marcus

-- 
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 persist JDO- one to many

2010-07-12 Thread lisandrodc
Hi! Prashant/Hariharan. The problem was that I don´t have the
annotation in the collection:

@Persistent(mappedBy = "torneo", defaultFetchGroup = "true")
private List equiposTorneo;

The defaultFetchGroup = "true" is critical and in the documentation of
google it is not...
I did not have to detach collections fields...
Regards

On 12 jul, 12:43, Hariharan Anantharaman
 wrote:
> Hi Lisan,
> In the Torneo class, i am not seeing "mappedBy" attribute for @persistent
> tage for field
>
>      private List equiposTorneo;
>
> That is required to make this a owned one-many collection. Only then it
> might be possible to get collection of Equipo when retrieving Torneo  .
>
> Thanks
> Hari
>
> 2010/7/12 Prashant 
>
> > you need to create a new method in Torneo which will detach collections
> > field. Now you just need to call this function with PersistenceManager as
> > argument.
>
> > public Torneo devolverTorneo(Long idTorneo) {
>
> >              Torneo b = pm.getObjectById(Torneo.class, idTorneo);
>
> >    b.detachFields(pm);
> >    b=pm.detachCopy(b);
> >    pm.close();
>
> >              return b;
> >              //The method return the object for update
>
> > }
>
> > public class Torneo implements Serializable{
> > 
>
> > public void detachFields(PersistenceManager pm) {
>
> >  pm.detachCopyAll(equiposTorneo);
>
> > }
>
> > 
> > }
>
> > --
> > Prashant
> >www.claymus.com
>
> >  --
> > You received this message because you are subscribed to the Google Groups
> > "Google App Engine for Java" group.
> > To post to this group, send email to
> > google-appengine-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] How to upload primary key as an id instead of name

2010-07-12 Thread John Patterson
If you use the RemoteDatastore you have complete control in Java of  
what you key is.


http://code.google.com/p/remote-datastore/

e.g. this code puts an entity with the id set in your remote datastore  
from your local machine:


RemoteDatastore.install();
RemoteDatastore.divert("http://myVersion.latest.myApp.appspot.com/remote-datastore 
", "myApp", "myVersion");
DatastoreService service =  
DatastoreServiceFactory.getDatastoreService();


Key key = KeyFactory.createKey("MyKindName, 35);
Entity entity1 = new Entity(key);
entity1.setProperty("property1", "hello");
datastore.put(Arrays.asList(entity1, entity2);

On 30 Jun 2010, at 14:12, MANISH DHIMAN wrote:


Hi All
When I upload data using CSV file on G A E. Primary key is stored
there as a name instead of id.
Example.

Format of .yaml is Given below
transformers:
- kind: City
 connector: csv
 connector_options:
   encoding: utf-8
   columns: from_header
 property_map:
   - property: __key__
 external_name: CityId
 export_transform: datastore.Key.id
   - property: Name
 external_name: Name

Primary key stored there is:
ID/Name   Name
name=1Delhi
name=2London

Due to uploaded data with name=, when I am try to get Key
from any Fetched Entities, then Key contains only name value but id
value is 0 and also name contains long value as a String instance.

Is it possible to store primary key(Using CSV while uploading data) in
a format given below :
ID/Name  Name
id=1Delhi
id=2London

When data is stored with id=, then Key contains id value is
 as long instance.

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




--
You received this message because you are subscribed to the Google Groups "Google 
App Engine for Java" group.
To post to this group, send email to google-appengine-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] How to query a __key__ in Datastore Viewer

2010-07-12 Thread Ikai L (Google)
Try this:

SELECT * FROM PreparedTransaction WHERE
__key__=KEY('agdwYXllbGV4cjkLEhNQcmVwYXJlZFRyYW5zYWN0aW9uIiAwMDAwMGNjMjMwYzg2MTFjZTFhOWZjZDJkZDEzMWMyNww')

This is documented here:

http://code.google.com/appengine/docs/python/datastore/gqlreference.html

On Mon, Jul 12, 2010 at 6:25 AM, cse.zh...@gmail.com wrote:

> Dear all,
> How Can I query a __key__ in Datastore Viewer?
>
> I tried the following method:
> SELECT * FROM PreparedTransaction WHERE
> name='0cc230c8611ce1a9fcd2dd131c27'
>
> SELECT * FROM PreparedTransaction WHERE
>
> __key__='agdwYXllbGV4cjkLEhNQcmVwYXJlZFRyYW5zYWN0aW9uIiAwMDAwMGNjMjMwYzg2MTFjZTFhOWZjZDJkZDEzMWMyNww'
>
> All these failed.
>
> Is there any way to achieve this?
>
> I am looking this forum and google for hours, but can't find any clue.
>
> Best regards,
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine for Java" group.
> To post to this group, send email to
> google-appengine-j...@googlegroups.com.
> To unsubscribe from this group, send email to
> google-appengine-java+unsubscr...@googlegroups.com
> .
> For more options, visit this group at
> http://groups.google.com/group/google-appengine-java?hl=en.
>
>


-- 
Ikai Lan
Developer Programs Engineer, Google App Engine
Blog: http://googleappengine.blogspot.com
Twitter: http://twitter.com/app_engine
Reddit: http://www.reddit.com/r/appengine

-- 
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: how should I design my data model for following scenario

2010-07-12 Thread pac
Another way I can think of divide the kind and do some form of keys
only query on ItemIndex and transform them to parent keys (http://
www.youtube.com/watch?v=AgaL6NGpkB8) and then filter in memory as per
invoiceDate? But this way I may end fetching lots of invoices which do
not meet criteria, any  suggestions?

class Invoice
{
@Id Long id;
Date invoiceDate;
Long invoiceNo;
}

class ItemIndex
{
@Id Long id;
@Parent Key invoice;
List items;
}

On Jul 12, 7:21 am, Parvez  wrote:
> Thanks Robert.
> I don’t think that will solve it.
> I think text search could have solved it easily, which is not in at
> the moment, unfortunately.
>
> If I design it something like this (Item as concatenated strings of
> items separated by a space):
>
> InvoiceNo          Item                         InvoiceDate
>
> 10                      item_a
> 11                      item_a item_b item_z
> 12                      item_a item_c item_x
> 13              item_a item_x
>
> I am not sure how text search will work or going to look like when in,
> but just say may be something like this
>
> SELECT * FROM  Invoice WHERE item CONTAINS(“item_a”, “item_b”) AND
> InvoiceDate >= someDate AND  InvoiceDate < someOtherDate
>
> I implemented search as suggested in various posts/blog, but that is
> not working as I have a range scan as well and due to that GAE always
> put range scan in the end and that result in lots of indexes.
>
> e.g.
> If I have one item to search in invoice then it will need following
> index (even in query if I put date filter first, then still it will
> put date scan in end, as range is last, otherwise I could get away
> with one large index)
>
>     
>         
>         
>     
>
> If I have 2 items to search then it needs
>
>     
>         
>        
>         
>     
>
> and so on.
>
> Any thoughts/suggestions?
>
> On Jul 11, 1:55 pm, Robert Lancer  wrote:
>
> > I dont fully understand the problem, but you might want to look into
> > using the IN filter option that can take a list of items and return
> > the associated entities, if the list is small enough you can cook up
> > the set operations in memory.
>
> > On Jul 11, 6:58 am, Parvez  wrote:
>
> > > I want retrieve invoice numbers depending upon items e.g.
>
> > > InvoiceNo        Item          InvoiceDate
>
> > > 10      item_a
> > > 11      item_a
> > > 11      item_b
> > > 11      item_z
> > > 12      item_a
> > > 12      item_c
> > > 12      item_x
> > > 13      item_a
> > > 13      item_x
>
> > > User can search on item(s) and can also include period (invoice date)
> > > as part of search.
> > > Initially, I tried using list property for Item, it worked but then it
> > > failed once more than 6, 7 items included in query along with date
> > > i.e. "Too many indexed properties for entity.." [:-) then I found out
> > > that I can not delete index in java, using java sdk 1.3.5, it works
> > > locally, but does not work when application uploaded]
>
> > > In above example if user query for "item_a" and  "item_b" then I
> > > should only get invoice number 11.
> > > Any suggestion how can I achieve this?
> > > 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] Java Server Faces 2.0 does not works in GAE (for me)

2010-07-12 Thread SammyBar
Hi all,

I'm trying to config my first Java Server Faces project with GAE. I
have already configured my Eclipse following instructions published at
https://sites.google.com/a/wildstartech.com/adventures-in-java/Java-Platform-Enterprise-Edition/JavaServer-Faces/sun-javaserver-faces-reference-implementation/configuring-jsf-20-to-run-on-the-google-appengine,
and also included the fix on the jsf-impl-gae.jar. I'm able to run my
project in Eclipse without errors. The console displays "INFO: The
server is running at http://localhost:/";. It looks everything is
OK.
But when I direct the browser to the above mentioned URL, I get a HTTP
404 error "/welcome.jsf not found"
I'm able to put a breakpoint in the index.jsp page at "<%
response.sendRedirect("welcome.jsf"); %>" It confirms me the app is
working because the breakpoint is reached, but it looks like the
server is unable to "understand" the "welcome.xhtml" file should be
processed as "welcome.jsf". Similarly by pointing the browser to
http://localhost:/welcome.xhtml also returns a 404 error. What is
wrong with my configuration?

Any hint is welcomed.
Thanks in advance
Sammy

Follows the appengine-web.xml and web.xml files from my war/WEB-INF
folder which are copies of the reccommended files published in the
above mentioned site:

--- appengine-web.xml


http://appengine.google.com/ns/1.0";>
TestJSF
1
true








--- web.xml


http://java.sun.com/xml/ns/javaee";
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
  xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd";>
  
Wildstar Technologies, LLC. Google AppEngine JSF 2.0 Template
  
  
Template JSF 2.0 application configured to run on the Google
AppEngine for Java.
  
  
  
javax.faces.STATE_SAVING_METHOD
server
  
  
  javax.faces.DEFAULT_SUFFIX
.xhtml
  
  
  
com.sun.faces.expressionFactory
com.sun.el.ExpressionFactoryImpl
  
  

  Set this flag to true if you want the JavaServer Faces
  Reference Implementation to validate the XML in your
  faces-config.xml resources against the DTD. Default
  value is false.

com.sun.faces.validateXml
true
  
  
  

  When enabled, the runtime initialization and default
ResourceHandler
  implementation will use threads to perform their functions. Set
this
  value to false if threads aren't desired (as in the case of
running
  within the Google Application Engine).

  Note that when this option is disabled, the ResourceHandler will
not
  pick up new versions of resources when ProjectStage is
development.

com.sun.faces.enableThreading
false
  
  
  
Faces Servlet
javax.faces.webapp.FacesServlet
1
  
  
Faces Servlet
/faces/*
*.jsf
  
  
30
  
  
index.jsp
index.xhtml
index.html
  


-- 
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: Best performance for deleting and inserting entities

2010-07-12 Thread John Patterson


On 11 Jul 2010, at 04:30, jd wrote:


On Jul 11, 4:23 am, John Patterson  wrote:

It is about the same speed.  I've just uploaded 500,000 entities in
The new Mapping API sounds like the ideal solution but it is python
only at the moment.


Ikai wrote a great article introducing the Java version of the Mapper  
API:


http://ikaisays.com/2010/07/09/using-the-java-mapper-framework-for-app-engine/

It looks like at the moment the Java version has no built in support  
for mapping lines in a file in the Blob store (I think the python  
version does).   Ikai says that in a future article he'll cover  
writing an InputFormat which is what is needed to read from the  
blobstore. 


--
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 and pm.close()?

2010-07-12 Thread Andrés Cerezo
 I've executed the program and now is right!!!. However now I have another
problem if I executed this source code, the system tells me that the
transaction is still active, for the second getUser. I'm using Junit perhaps
is for this?.

public void test3UserFindById() {

try {
UserInfo user =
com.admin.waves.persistence.businesstier.UserService
.getUser(userID);
assertNotNull(user);

} catch (ServiceException e) {
fail(e.getMessage());
}


try {
UserInfo user =
com.admin.waves.persistence.businesstier.UserService
.getUser(userID);
assertNotNull(user);

} catch (ServiceException e) {
fail(e.getMessage());
}
}

Thanks.

2010/7/12 boustanihani 

> Yes indeed, here is the error ... the PersistenceManagerFactory should
> be the singleton not the PersistenceManager. Managers should be
> created and ended each time data-access is needed!
>
> After u close a PersistenceManager u may not reuse it again ... and
> this is what was happening because your PersistenceManagerHelper was
> always returning the same instance! Let it always return a new
> PersistenceManager and your code will work!
>
> See =>
>
> http://db.apache.org/jdo/api22/apidocs/javax/jdo/PersistenceManager.html#close()
>
> regards
> Hani
>
> --
> 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] OAUTH for app engine

2010-07-12 Thread sonic
yes, you can, but it's a little bit undocumented.
checkout: http://code.google.com/p/gaeoauthdemo/

On Sun, Jul 11, 2010 at 12:16 PM, compeng4lf  wrote:

> Can the Google Appengine OAUTH API work with other sites?  Meaning can
> you use this API to authenticate on different sites e.g. Twitter.
>
> --
> 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.
>
>


-- 
Cai Jian

-- 
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: How to query a __key__ in Datastore Viewer

2010-07-12 Thread cse.zh...@gmail.com
Hi Ikai,
What a great help!

Thanks very much.
BR.

On 7月13日, 上午5时57分, "Ikai L (Google)"  wrote:
> Try this:
>
> SELECT * FROM PreparedTransaction WHERE
> __key__=KEY('agdwYXllbGV4cjkLEhNQcmVwYXJlZFRyYW5zYWN0aW9uIiAwMDAwMGNjMjMwYzg2MTFjZTFhOWZjZDJkZDEzMWMyNww')
>
> This is documented here:
>
> http://code.google.com/appengine/docs/python/datastore/gqlreference.html
>
> On Mon, Jul 12, 2010 at 6:25 AM, cse.zh...@gmail.com 
> wrote:
>
>
>
> > Dear all,
> > How Can I query a __key__ in Datastore Viewer?
>
> > I tried the following method:
> > SELECT * FROM PreparedTransaction WHERE
> > name='0cc230c8611ce1a9fcd2dd131c27'
>
> > SELECT * FROM PreparedTransaction WHERE
>
> > __key__='agdwYXllbGV4cjkLEhNQcmVwYXJlZFRyYW5zYWN0aW9uIiAwMDAwMGNjMjMwYzg2MTFjZTFhOWZjZDJkZDEzMWMyNww'
>
> > All these failed.
>
> > Is there any way to achieve this?
>
> > I am looking this forum and google for hours, but can't find any clue.
>
> > Best regards,
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Google App Engine for Java" group.
> > To post to this group, send email to
> > google-appengine-j...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > google-appengine-java+unsubscr...@googlegroups.com
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/google-appengine-java?hl=en.
>
> --
> Ikai Lan
> Developer Programs Engineer, Google App Engine
> Blog:http://googleappengine.blogspot.com
> Twitter:http://twitter.com/app_engine
> Reddit:http://www.reddit.com/r/appengine

-- 
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: times out - while creating too many entities

2010-07-12 Thread Didier Durand
Hi aswath,

I would exactly do what Pieter suggests as the tasks you're posting in
queue are guaranteed to execute by App Engine if you include them in
the transaction : see 
http://code.google.com/appengine/docs/java/taskqueue/overview.html#Task_Within_Transactions

The only issue after this split is that you may have to synchronize
after the 10th task ends if something needs to be done after the 100th
entity has been created.

didier

On Jul 12, 11:43 am, aswath satrasala 
wrote:
> Hello,
> I have situation where I am creating atleast 100 entities in one request.
> All the 100 entities has the same parent.
> The appengine times out with DeadlineExceeded exception.
>
> Any suggestions on how to avoid the DeadlineExceeded exception.
>
> -Aswath

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



[appengine-java] Re: Datastore and Polymorphic support getObjectByID(Parent.class, childKey)

2010-07-12 Thread Didier Durand
Hi Doug,

You should do some key.toString() on your keys to understand your
problem: the Key contains the name of the class by default. So, when
you query on GameRound, you'll never find a SentenceRound or a
PictureRound.

[Also check 
http://code.google.com/appengine/docs/java/datastore/relationships.html#Polymorphic_Relationships]

You have to use the KeyFactory class to generate the proper key to
allow for your polymorphic relation ship. See available examples at
http://code.google.com/appengine/docs/java/datastore/creatinggettinganddeletingdata.html#Creating_and_Using_Keys.

Secondly, after they keys are right, you have to make sure that the
DataStore stores your different entities in the same table via the
annotation @Inheritance(custom-strategy=xxx). See
http://www.jpox.org/docs/1_2/jdo_orm/inheritance.html.

regards
didier

On Jul 12, 3:05 am, Doug Daniels  wrote:
> I'm trying to model a polymorphic relationship in JDO, List
> where each GameRound could be either a TextRound or PictureRound.
>
> I've followed the documentation and modeled the association as a
> List as 
> described:http://code.google.com/appengine/docs/java/datastore/relationships.ht...
>
> // ... imports ...
>
> @PersistenceCapable
> public class Chef {
>     @PrimaryKey
>     @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
>     private Key key;
>
>     @Persistent
>     private Key favoriteRecipe;
>
> }
>
> Here is my Game object:
>
> @PersistenceCapable
> public class Game {
>
>     @PrimaryKey
>     @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
>     private Key key;
>
>     @Persistent
>         private List rounds = new ArrayList();
> ...
>
> }
>
> @PersistenceCapable
> @Inheritance(strategy = InheritanceStrategy.SUBCLASS_TABLE)
> public class GameRound {
> ...
>
> }
>
> @PersistenceCapable
> public class SentenceRound extends GameRound {
>     @PrimaryKey
>     @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
>     private Key key;
>
> ...
>
> }
>
> @PersistenceCapable
> public class PictureRound extends GameRound {
>     @PrimaryKey
>     @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
>     private Key key;
> ...
>
> }
>
> The trouble is in my Game object I iterate through the rounds and try
> to do a persistenceManager.getObjectById(GameRound.class, key) and I
> get the following exception:
>
> WARNING: /viewGames.jsp
> javax.jdo.JDOFatalUserException: Exception converting SentenceRound(7)
> to an internal key.
>         at
> org.datanucleus.store.appengine.jdo.DatastoreJDOPersistenceManager.getObjectById(DatastoreJDOPersistenceManager.java:
> 68)
>         at org.apache.jsp.viewGames_jsp._jspService(viewGames_jsp.java:121)
>         at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
>
> What's the proper way to retrieve a polymorphic key relationship (for
> example how would you do it in the Appengine Chef example?).
>
> My only other option is to model the relationship as mutually
> exclusive properties of the GameRound (and manage that in my
> application logic).
>
> @PersistenceCapable
> @Inheritance(strategy = InheritanceStrategy.SUBCLASS_TABLE)
> public class GameRound {
>
>         @PrimaryKey
>         @Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
>         private Key key;
>
>         //Model relationships as optional components because JDO and
> Appengine don't support
>         //Polymorphic relationships well.
>
>         @Persistent
>         private SentenceRound sentenceRound;
>
>         @Persistent
>     private PictureRound pictureRound;
>
> ...
>
> }
>
>

-- 
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 storing data in datastore

2010-07-12 Thread Akriti Kalra
The file is very small nowhere near 1 MB. What I am doing is loading
the file as a stream and immediately parsing the stream and creating
datastore entities with the data. I am not actually trying to save the
file. In the local server it works. It even works when I try to access
the local server from another machine. However it does not work when I
deploy it to Appengine using the Google Plugin for Eclipse. My parsing
code depends on resource files which are under the web-inf  directory.
Is it possible these resource files are not getting uploaded and is
there a way to check what files are uploaded on Appengine?

On Jul 12, 11:55 pm, Pieter Coucke  wrote:
> Check the logs or add your own logging to check if the file arrives.
> Files are limited to 1 MB in the datastore.  Use the blobstore service for
> bigger files and easy (public) uploading.
>
>
>
> On Mon, Jul 12, 2010 at 1:35 PM, Akriti Kalra  wrote:
> > I am facing a problem with file upload.I have used Apache Commons
> > servlet file upload for uploading the file. Though the file is getting
> > uploaded and the data is getting stored on the local server(http://
> > 127.0.0.1:/_ah/admin/datastore) but it is not going to the Google
> > App Engine datastore.  Can anyone locate the actual problem?
>
> > Thank you
> > Akriti
>
> > --
> > 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.
>
> --
> Pieter Coucke
> Onthoo BVBAhttp://www.onthoo.comhttp://www.koopjeszoeker.be

-- 
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: Problem persist JDO- one to many

2010-07-12 Thread Prashant
Yes, it worked without explicitly detaching fields with just  defaultFetchGroup
set to "true".

btw,
mappedBy property is required only for bi-directional mapping.

-- 
Prashant
www.claymus.com

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine for Java" group.
To post to this group, send email to google-appengine-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: GAE JavaMail jumbles UTF-8

2010-07-12 Thread Peter Ondruska
You should encode subject if using non-ASCII:

msg.setSubject(MimeUtility.encodeText(_subject, "UTF-8", "Q"));

On Jul 12, 9:03 pm, Pieter Coucke  wrote:
> I can only confirm I see the same issue when sending e-mail with a German ü
> in the subject.  I haven't found a solution yet.
>
>
>
>
>
> On Mon, Jul 12, 2010 at 3:04 PM, Marc Hacker  wrote:
> > On Google App Engine Java email service, I am trying to send a UTF8
> > (Hebrew) email subject and body but they arrive (in Gmail) jumbled  as
> >
>
> > Here is my code
>
> >        MimeMessage msg = new MimeMessage(session);
> >        msg.setSubject(emailSubject, "UTF-8");
>
> >        Multipart mp = new MimeMultipart();
> >        MimeBodyPart htmlPart = new MimeBodyPart();
> >        htmlPart.setContent(htmlBody, "text/html; charset=UTF-8");
> >        mp.addBodyPart(htmlPart);
> >        msg.setContent(mp);
> >        Transport.send(msg);
>
> > I noticed that my browser is treating the email when viewed in Gmail
> > us Unicode UTF8 so that isn't the problem.
>
> > Any ideas please?
>
> > Marc
>
> > --
> > 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.
>
> --
> Pieter Coucke
> Onthoo BVBAhttp://www.onthoo.comhttp://www.koopjeszoeker.be

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