No se puede acceder a los datos de la sesión de Hibernate mediante un procedimiento almacenado

I have a method running under spring transaction which calls two stored procedures.

  1. First stored procedure executes successfully, but data is not committed yet (Because of transaction)
  2. Now, Second stored procedure tries to query the previous data which is not available.

Can somebody give me pointers on how to share the uncommitted data to the (second)stored procedure.

Note:Cant use isolation uncommitted as i am using oracle database and it doesn't support the same.

PS :- when searched i got answers which asked me to flush the hibernate session. But didn't work for me.

preguntado el 05 de mayo de 13 a las 18:05

I don't see what the hibernate session has to do with the problem. Stored procedures are executed inside the database. And given everything is in a single transaction, I don't see why the second SP can't see the modifications done by the first SP. -

If you are using the same session to execute the second procedure it should work properly. Share your code if possible to get the perfect answer. -

1 Respuestas

Use one stored procedure. If you can't do that, commit after the first stored procedure, as the second SP needs to be able to query the first's outcome, so that automatically is your tx boundary.

contestado el 05 de mayo de 13 a las 22:05

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.