Hello,
I have a postgreSQL Database on my server at home and I access it via java. From my own network, everything works fine and quick, but from a remote machine, it takes about 150 ms per Entity.
We have nested Objects in those entities like this:
Series.java:
Code:
@Entity
public class Series implements Serializable {
@Id
private int id;
@ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
private Set<Player> players;
....
}
The datasource is configured in a JBoss 7.1.1. We use JTA-Transaction type.
Why does the query take so long? Is there something we could configure or annotate better?
This is our persistence.xml:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<persistence version="1.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd">
<persistence-unit name="PlayerService" transaction-type="JTA">
<jta-data-source>java:jboss/PlayerService</jta-data-source>
<properties>
<property name="hibernate.show_sql" value="false"/>
<property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect" />
<property name="hibernate.query.jpaql_strict_compliance" value="false" />
<!-- EntityManager-Zugriff per JNDI aktivieren -->
<property name="jboss.entity.manager.jndi.name" value="java:jboss/PlayerService" />
</properties>
</persistence-unit>
</persistence>
Greetings,
Wanroto