[ 
http://mifosforge.jira.com/browse/MIFOS-3055?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=58226#action_58226
 ] 

Udai Gupta commented on MIFOS-3055:
-----------------------------------

In PersonnelBO.hbm.xml 

<many-to-one name="status" column="PERSONNEL_STATUS" 
class="org.mifos.customers.personnel.business.PersonnelStatusEntity" />

disabling lazy loading for PersonnelStatusEntity should be fine as its fine to 
load the status of a personnel when loading PersonnelBO as won't be a 
performance overhead.

<many-to-one name="status" column="PERSONNEL_STATUS" 
class="org.mifos.customers.personnel.business.PersonnelStatusEntity" 
lazy="false" />

commit transaction releases the connection so with new connection lazy loading 
fails.

The alternate solution for this problem could have been adding/using a flag in 
HibernateUtil which avoid commits during multiple service calls for tests. This 
will allow tests to control transactional behavior (rollback). But this can't 
be used at everyplace as some methods depends on some commits in the same 
service call.

Using HibernateUtil.commitTransaction() in middle of service call is wrong as 
those changes can't be rollback. It should be fine to use/add 
HibernateUtil.flushTransaction() (session.flush()) which will reflect the 
changes to a particular transaction but the flushed things can be rollback at 
end if required.



> investigate the  could not initialize proxy - no Session in 
> CenterStatusChangeIntegrationTest
> ---------------------------------------------------------------------------------------------
>
>                 Key: MIFOS-3055
>                 URL: http://mifosforge.jira.com/browse/MIFOS-3055
>             Project: mifos
>          Issue Type: Dev Task
>          Components: Build and Testing
>            Reporter: Shahzada Hatim
>            Assignee: Shahzada Hatim
>            Priority: Major
>
> Getting this error in getStatusAsEnum() method PersonnelBO.java

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://mifosforge.jira.com/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
Mifos-issues mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mifos-issues

Reply via email to