When I execute an UPDATE in MyBatis it hangs, if I put timeout"20" it interrupts the execution due to excess time.
Mappers:
<update id="actualizarUnaSalida" timeout="20">
UPDATE dbo.TbSALIDAS
SET Facturado=1
WHERE IdSalidas = 599
</update>
Call to Update
session = ConnectionFactory.getSessionCatalogos().openSession();
daoDetalleCatalogo = session.getMapper(DetalleCatalogoEspecialBeanMapper.class);
daoDetalleCatalogo.actualizarUnaSalida();//<- Entra pero no sale
As you can see, the UPDATE is as simple as possible in case the error came from parameters or something like that.
Although I don't put the Mappings, that's fine since I use the DetailCatalogEspecialBeanMapper class to do SELECT and that works.
As a detail I want to comment that when I run the application and it hangs on the Update if I open the SQL Management and try to do an UPDATE it doesn't work either, it's like it leaves it blocked, instead SELECT if it executes.
If anyone can give me a clue, I'd appreciate it.
In the end I managed to detect the error.
What was happening was that the Update, Delete and Insert were blocked because the session had not been closed in the previous query.
Thanks to this query here I have managed to find out which query was blocking my Update and thus find the Sql server database blocking error.