Archive for October 2010
Google App Engine More JPA Gotchas
We were in process of porting an application to GAE. The application used JPA for persistence and we decided to use the same for GAE as well. After deploying, the application worked fine on Google App Engine. Over a period of time we started getting errors, which seemed strange. All our tests were running fine and application worked without any issues with our seed data. Where was the problem!
The application had some IN queries in our JPA code which failed after the data changed on GAE production environment.
We have a JPA Entity TimesheetEntry and a Data Access Object JpaDetailedReportDao which fetches TimesheetEntry based on ProjectAssignment Keys. We used JPA IN Query to extract timesheet entries. Let’s look at the code listing.
@Entity public class TimesheetEntry { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Key timesheetEntryKey; private Key projectAssignmentKey; private Float hours; private Date entryDate; . . . }