Ver Mensaje Individual
  #1 (permalink)  
Antiguo 23/10/2012, 15:55
adrianapy04
 
Fecha de Ingreso: octubre-2012
Mensajes: 1
Antigüedad: 11 años, 6 meses
Puntos: 0
Problemas para persistir en postgresql usando un EJB en eclipse

Hola a todos,
Estoy haciendo una aplicacion en la cual utilizo ejb , postgresql y programo en eclipse. Estoy teniendo problemas para realizar la persistencia. Este es parte del codigo
public boolean guardarProducto(entity.beans.Producto producto) {
try{

if (producto.getCodProducto()!=null){

mgr.merge(producto);
return true;
}else{

mgr.persist(producto);

return true;
}
}catch (Exception e) {
e.printStackTrace();
return false;
}finally{
//if (mgr!=null) mgr.close();
}

}

y el errror es:
18:33:59,328 WARN [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (http-localhost-127.0.0.1-8080-1) SQL Error: 0, SQLState: 42601
18:33:59,328 ERROR [org.hibernate.engine.jdbc.spi.SqlExceptionHelper] (http-localhost-127.0.0.1-8080-1) ERROR: error de sintaxis en o cerca de «call»
Position: 1
18:33:59,332 ERROR [stderr] (http-localhost-127.0.0.1-8080-1) javax.persistence.PersistenceException: org.hibernate.exception.SQLGrammarException: ERROR: error de sintaxis en o cerca de «call»
18:33:59,332 ERROR [stderr] (http-localhost-127.0.0.1-8080-1) Position: 1

18:33:59,333 ERROR [stderr] (http-localhost-127.0.0.1-8080-1) at org.hibernate.ejb.AbstractEntityManagerImpl.conver t(AbstractEntityManagerImpl.java:1361)

18:33:59,333 ERROR [stderr] (http-localhost-127.0.0.1-8080-1) at org.hibernate.ejb.AbstractEntityManagerImpl.conver t(AbstractEntityManagerImpl.java:1289)

18:33:59,334 ERROR [stderr] (http-localhost-127.0.0.1-8080-1) at org.hibernate.ejb.AbstractEntityManagerImpl.conver t(AbstractEntityManagerImpl.java:1295)

18:33:59,334 ERROR [stderr] (http-localhost-127.0.0.1-8080-1) at org.hibernate.ejb.AbstractEntityManagerImpl.persis t(AbstractEntityManagerImpl.java:859)

18:33:59,336 ERROR [stderr] (http-localhost-127.0.0.1-8080-1) at org.jboss.as.jpa.container.AbstractEntityManager.p ersist(AbstractEntityManager.java:563)

18:33:59,336 ERROR [stderr] (http-localhost-127.0.0.1-8080-1) at session.beans.Producto.guardarProducto(Producto.ja va:54)