Glassfish - Java EE application from 32-bit to 64-bit OS, incomplete database queries?

I ran into a very very strange problem moving from 32 to 64-bit. I have 2 envirnoments:

  • Development - Windows XP 32bit
  • Products - Windows 2008 R2 64bit Server

On both systems I use jdk7u1 32bit, Glassfish 3.1.1 Web Profile with default JPA (eclipselink). In production, I have Oracle Database 11g Release 11.2.0.1.0 32bit. In Glassfish, I use the appropriate driver from Oracle (ojdbc6.jar). I also have a Java EE application that loads a list of products from a database view and shows it to the user, nothing special.

When I deploy the computer development application and connect to the production database, everything is fine, I can see all the records. BUT, when I deploy to production the envirnoment named query returns only a few records. No errors, warnings, etc. The application behaves as if there are no more records, but it is not. On both machines, the connection properties are exactly the same. When I connect to SQL Developer from both computers, I see all the records.

I have no idea what is going on. The only difference is the OS, but this should not cause problems, since the JDK is the same. I'm right?

+4
source share
1 answer

You may have a cache problem. I remember that Toplink (EclipseLink base) has a caching mechanism by default. So if this is a scenario:

  • If you created / changed entries from Machine A , these changes are not reflected in Machine B , since they did not update its cache.
  • If you created / modified records outside of your Glassfish (EclipseLink), these records are not updated in EclipeLink, not Machine A or Machine B

You can verify that it changes the record directly in the database and checks that it is reflected on both machines, if the change is not reflected, you have a cache problem and you can configure it according to the following documentation:

http://wiki.eclipse.org/Introduction_to_Cache_%28ELUG%29

0
source

Source: https://habr.com/ru/post/1381157/


All Articles