Gentlemen,
My
application is desktop (swing, iReport 3.6.2, EclipseLink
1.2.0.v20091016-r5565, Postgresql 8.4) and run on JRE 1.6.0_17. This
application is running on the LAN and the Internet via the JWS (Java
Web Start), it follows that access the Internet via JWS is very time
consuming, taking around 15 to 20 minutes to make the connection to the
database (Mandriva 2009 -- Apache HTTP Server 2.0).
Is
there any way to improve this time from connection to the database?
The following configurations:
private GnsSvrGrs1a() {
// Mudando as propriedades da conexão.
propriedades = new HashMap<String, Object>();
propriedades.put(PersistenceUnitProperties.CLASSLOADER,
this.getClass().getClassLoader());
if
(this.getClass().getResource("GnsSvrGrs1a.class").getPath().contains("XXX.XX.XXX.XXX")){
propriedades.put(PersistenceUnitProperties.CLASSLOADER,
GnsSvrGrs1a.class.getClassLoader());
propriedades.put(PersistenceUnitProperties.JDBC_USER,
"postgres");
propriedades.put(PersistenceUnitProperties.JDBC_PASSWORD,
"xxxxxx");
propriedades.put(PersistenceUnitProperties.JDBC_URL,
"jdbc:postgresql://XXX.XX.XXX.XXX:5432/genesis");
propriedades.put(PersistenceUnitProperties.JDBC_DRIVER,
"org.postgresql.Driver");
propriedades.put(PersistenceUnitProperties.LOGGING_LEVEL,
"FINE");
propriedades.put(PersistenceUnitProperties.LOGGING_TIMESTAMP, "false");
propriedades.put(PersistenceUnitProperties.LOGGING_SESSION,
"false");
propriedades.put(PersistenceUnitProperties.LOGGING_THREAD,
"false");
}
try {
EntityManagerFactory emf =
Persistence.createEntityManagerFactory("GENESIS-GERAIS", propriedades);
em = emf.createEntityManager();
} catch (Exception e) {
e.printStackTrace();
}
}// GnsSvrGrs1a.
public static GnsSvrGrs1a getInstancia() {
if (instanciaGnsSvrGrs1a == null) {
instanciaGnsSvrGrs1a = new GnsSvrGrs1a();
}
return instanciaGnsSvrGrs1a;
}// getInstancia.
Regards,
Olavo Jr.
|