I turned on the DEBUG level for the transaction package. According to
the log the transactions are executing serially. I'm copping the log
and my redirection code:
public ModelAndView salva(HttpServletRequest request,
HttpServletResponse response) throws Exception
{
PedidoCompra pedidoCompra = obterPedidoCompra(request);
manager.saveObject(pedidoCompra);
ModelAndView mav = new ModelAndView("redirect:/pedidosCompra.html");
mav.addObject("busca", "true");
mav.addObject("fornecedorId", pedidoCompra.getFornecedor().getId());
mav.addObject("inicio",
DateUtil.convertDateToString(Calendar.getInstance().getTime()));
return mav;
}
[cityshoes] DEBUG [http-8080-Processor23]
TransactionInterceptor.createTransactionIfNecessary(222) | Getting
transaction for br.com.facio.cityshoes.service.Manager.saveObject
...
[cityshoes] DEBUG [http-8080-Processor23]
TransactionSynchronizationManager.initSynchronization(214) |
Initializing transaction synchronization
...
[cityshoes] DEBUG [http-8080-Processor23]
TransactionInterceptor.doCommitTransactionAfterReturning(265) |
Invoking commit for transaction on
br.com.facio.cityshoes.service.Manager.saveObject
[cityshoes] DEBUG [http-8080-Processor23]
TransactionSynchronizationManager.clearSynchronization(265) | Clearing
transaction synchronization
...
[cityshoes] DEBUG [http-8080-Processor23]
TransactionInterceptor.createTransactionIfNecessary(222) | Getting
transaction for
br.com.facio.cityshoes.service.PedidoCompraManager.buscaPedidosCompra
...
[cityshoes] DEBUG [http-8080-Processor23]
TransactionSynchronizationManager.initSynchronization(214) |
Initializing transaction synchronization
...
[cityshoes] DEBUG [http-8080-Processor23]
TransactionInterceptor.doCommitTransactionAfterReturning(265) |
Invoking commit for transaction on
br.com.facio.cityshoes.service.PedidoCompraManager.buscaPedidosCompra
[cityshoes] DEBUG [http-8080-Processor23]
TransactionSynchronizationManager.clearSynchronization(265) | Clearing
transaction synchronization
On 12/15/06, Bryan Noll <[EMAIL PROTECTED]> wrote:
Hmmm... sounds odd to me. IIUC, all if this is happening serially
(aka... the display list part is cannot happen until the save part has
occurred, you're not spawning a separate thread or anything, but simply
redirecting, right?). The only way what you're describing would make
sense to me is if those two operations (OP1 being the save part, OP2
being the display list part) are working in different transactions, and
OP2 is issuing its db query before OP1 has committed its save. Can you
look at some debug level logging down in the spring stuff (there's a
transaction package down in there somewhere,
org.springframework.transaction I believe that you can enable debug
level logging for) that can verify that this is not occurring?
Luiz Fernando Rodrigues wrote:
> Hello appfuse users,
>
> I created two controllers in my application. One save some entity
> the other one list the saved entities with a filter (for example,
> entities created after yesterday).
> After saving an entity, I redirect to the list controller setting up
> some filters parameters where the saved entity should be considered.
> The problem is: some times the entity appears some times not. When it
> doesn't, if I refresh the page it appears. I setup the controller to
> sleep for 2 seconds after save an entity and now it always appears. I
> also tried to change the DAO code to call flush after saving the
> entity, but that didn't work.
> I'm using Hibernate to persist the entity. Has anyone experienced
> this before?
>
> thanks,
> Luiz
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]