Login

Username

Password





Register   Reset password

This is a read-only archive of the forum.

# mrt 1/30/2008 11:47 AM
I'm creating a new module, i've pretty much copied everything from the downloads module and been following the how to. The only problem is I can't update the objects via the admin page, I can create new objects fine, but if I try to edit or delete one it's just ignored. It goes back to the listing page without any errors.

I'm using session.SaveOrUpdate within the module and at that point the right properties are changed on the object. It does the save then redirects, nothing is changed on the page or in the database. I can't figure out where I've gone wrong.
# Efie 1/30/2008 2:53 PM
Maybe you can try to debug the action. I think somewhere an exception is thrown, and handled or after the excpetion the page is redirected. With your info I can only guess what went wrong. So debug from the edit or delete action.
# mrt 1/30/2008 3:35 PM
I've tried, can't see any exception being thrown. Is there something i can do to get nhiber to throw the exception, or log it using log4net? (i've not used that before)
# Efie 1/30/2008 4:33 PM
You can configure some settings regarding logging in the web.config, but I don't know the right configuration now, I'll have to take a look at this. Maybe someone else does the right configuration for the logging stuff.
# mgaerber 1/30/2008 7:25 PM
hi,

what version are you using? 1.5, the trunk?

We already had a similar question some time ago and as far as I remember it has been an issue with the NHibernate session not being flushed.

See here for the previous issue:
http://forum.hibernate.org/viewtopic.php?p=2366298

Maybe you could try to call flush explicitly in the dao class and see what happens.
# mrt 1/31/2008 11:54 AM
calling flush worked like a charm. Although I still don't know why my module is any different to the one I copied it from (that doesn't flush).

Thanks for your help!
# martijnb 1/31/2008 2:48 PM
Did you use transactions in the module? Either with the [Transactional] attributes or explicit transactions in code? Normally, the session is flushed when committing the transaction.