-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Hibernate performance issue with updates more than 10K recor
PostPosted: Sat Dec 15, 2012 3:44 am 
Newbie

Joined: Sat Dec 15, 2012 3:24 am
Posts: 2
I am presently trying to do a bulk upload operation where in i need to parse an excel and update the details into the database. The problem is the data needs to be stored into multiple tables and the relationship is maintained. The problem is not when i have about 50-100 records to updated, but hugely affected when i have around 50000 records to be updated. It takes ages to upload and sometimes the browser gives up waiting for the response to arrive. Please find below the code and the mapping files. Please let me know what i can do to increase the performance and complete the processing quicker.

Note: The cascades are all required
Code:
AccountDim.hbm.xml
    <?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!-- Generated Mar 19, 2012 9:24:47 AM by Hibernate Tools 3.3.0.GA -->
<hibernate-mapping>
    <class name="com.pyramis.cera.hibernate.AccountDim" table="V_ACCOUNT_DIM">
        <id name="acctDimIdN" type="long">
            <column name="ACCT_DIM_ID_N" precision="10" scale="0" />
             <generator class="sequence">
                <param name="sequence">ACCOUNT_DIM_SEQ</param>
            </generator>
        </id>
        <property name="gdwIdN" type="long">
            <column name="GDW_ID_N" precision="38" scale="0" not-null="true" />
        </property>
        <property name="pycisInstnIdN" type="java.lang.Long">
            <column name="PYCIS_INSTN_ID_N" precision="10" scale="0" />
        </property>
        <property name="acctNotesC" type="string">
            <column name="ACCT_NOTES_C" length="4000" />
        </property>
        <property name="trdSysShrtNmC" type="string">
            <column name="TRD_SYS_SHRT_NM_C" length="100" />
        </property>
        <property name="reimbAuthorizeD" type="date">
            <column name="REIMB_AUTHORIZE_D" length="7" />
        </property>
        <property name="reimbInitD" type="date">
            <column name="REIMB_INIT_D" length="7" />
        </property>
        <property name="reimbEffD" type="date">
            <column name="REIMB_EFF_D" length="7" />
        </property>
        <property name="acctGainLossAmtN" type="java.lang.Double">
            <column name="ACCT_GAIN_LOSS_AMT_N" precision="15" />
        </property>
        <property name="buySellIndC" type="string">
            <column name="BUY_SELL_IND_C" length="10" />
        </property>
        <property name="navImpcN" type="java.lang.Double">
            <column name="NAV_IMPC_N" precision="15" />
        </property>
        <property name="delIndC" type="string">
            <column name="DEL_IND_C" length="1" not-null="true" />
        </property>
        <property name="updUsrC" type="string">
            <column name="UPD_USR_C" length="12" />
        </property>
        <property name="updTsD" type="date">
            <column name="UPD_TS_D" length="7" />
        </property>
        <property name="insUsrC" type="string">
            <column name="INS_USR_C" length="12" not-null="true" />
        </property>
        <property name="insTsD" type="date">
            <column name="INS_TS_D" length="7" not-null="true" />
        </property>
        <set name="incidentAcctSecFacts" table="V_INCIDENT_ACCT_SEC_FACT" inverse="true" lazy="true" fetch="select" cascade="all-delete-orphan"  >
            <key>
                <column name="ACCT_DIM_ID_N" precision="22" scale="0" not-null="true" />
            </key>
            <one-to-many class="com.pyramis.cera.hibernate.IncidentAcctSecFact" />
        </set>
        <set name="incidentAcctFacts" table="V_INCIDENT_ACCT_FACT" inverse="true" lazy="true" fetch="select" cascade="all-delete-orphan"  >
            <key>
                <column name="ACCT_DIM_ID_N" precision="22" scale="0" not-null="true" />
            </key>
            <one-to-many class="com.pyramis.cera.hibernate.IncidentAcctFact" />
        </set>
        <set name="accountAttachmentFacts" table="V_ACCOUNT_ATTACHMENT_FACT" inverse="true" lazy="true" fetch="select" cascade="all-delete-orphan"  >
            <key>
                <column name="ACCT_DIM_ID_N" precision="22" scale="0" not-null="true" />
            </key>
            <one-to-many class="com.pyramis.cera.hibernate.AccountAttachmentFact" />
        </set>
    </class>
</hibernate-mapping>

IncidentDim.hbm.xml

    <?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!-- Generated Mar 19, 2012 9:24:47 AM by Hibernate Tools 3.3.0.GA -->
<hibernate-mapping>
    <class name="com.pyramis.cera.hibernate.IncidentDim" table="V_INCIDENT_DIM">
        <id name="incidentDimIdN" type="long">
            <column name="INCIDENT_DIM_ID_N" precision="10" scale="0" />
            <generator class="sequence">
                <param name="sequence">INCIDENT_DIM_SEQ</param>
            </generator>
        </id>
        <property name="errMemoIdC" type="string">
            <column name="ERR_MEMO_ID_C" length="60" not-null="true" unique="true" />
        </property>
        <property name="errMemoD" type="date">
            <column name="ERR_MEMO_D" length="7" />
        </property>
        <property name="idD" type="date">
            <column name="ID_D" length="7" not-null="true" />
        </property>
        <property name="incidentD" type="date">
            <column name="INCIDENT_D" length="7" not-null="true" />
        </property>
        <property name="ntfcD" type="date">
            <column name="NTFC_D" length="7" not-null="true" />
        </property>
        <property name="totGainLossN" type="java.lang.Double">
            <column name="TOT_GAIN_LOSS_N" precision="18"  scale="2"/>
        </property>
        <property name="ovrdAttachedAcctC" type="string">
            <column name="OVRD_ATTACHED_ACCT_C" length="1" />
        </property>
        <property name="gainLossCalcMthdC" type="string">
            <column name="GAIN_LOSS_CALC_MTHD_C" length="4000" />
        </property>
        <property name="deemedAnErrC" type="string">
            <column name="DEEMED_AN_ERR_C" length="1" not-null="true" />
        </property>
        <property name="errRatifiedC" type="string">
            <column name="ERR_RATIFIED_C" length="1" not-null="true" />
        </property>
        <property name="errAcctUsedC" type="string">
            <column name="ERR_ACCT_USED_C" length="1" not-null="true" />
        </property>
        <property name="aprvPrcsC" type="string">
            <column name="APRV_PRCS_C" length="4000" />
        </property>
        <property name="incidentShrtDescC" type="string">
            <column name="INCIDENT_SHRT_DESC_C" length="4000" />
        </property>
        <property name="incidentSumC" type="string">
            <column name="INCIDENT_SUM_C" length="4000" />
        </property>
        <property name="incidentNotesC" type="string">
            <column name="INCIDENT_NOTES_C" length="4000" />
        </property>
        <property name="delIndC" type="string">
            <column name="DEL_IND_C" length="1" not-null="true" />
        </property>
        <property name="updUsrC" type="string">
            <column name="UPD_USR_C" length="12" />
        </property>
        <property name="updTsD" type="date">
            <column name="UPD_TS_D" length="7" />
        </property>
        <property name="insUsrC" type="string">
            <column name="INS_USR_C" length="12" not-null="true" />
        </property>
        <property name="insTsD" type="date">
            <column name="INS_TS_D" length="7" />
        </property>
        <set name="incidentAttachmentFacts" table="V_INCIDENT_ATTACHMENT_FACT" inverse="true" lazy="true" fetch="select" cascade="all-delete-orphan"  >
            <key>
                <column name="INCIDENT_DIM_ID_N" precision="10" scale="0" not-null="true" />
            </key>
            <one-to-many class="com.pyramis.cera.hibernate.IncidentAttachmentFact" />
        </set>
        <set name="incidentActionItemFacts" table="V_INCIDENT_ACTION_ITEM_FACT" inverse="true" lazy="true" fetch="select" cascade="all-delete-orphan"  >
            <key>
                <column name="INCIDENT_DIM_ID_N" precision="22" scale="0" />
            </key>
            <one-to-many class="com.pyramis.cera.hibernate.IncidentActionItemFact" />
        </set>
        <set name="incidentAcctSecFacts" table="V_INCIDENT_ACCT_SEC_FACT" inverse="true" lazy="true" fetch="select" cascade="all-delete-orphan"  >
            <key>
                <column name="INCIDENT_DIM_ID_N" precision="22" scale="0" not-null="true" />
            </key>
            <one-to-many class="com.pyramis.cera.hibernate.IncidentAcctSecFact" />
        </set>
        <set name="irgMemberAssignmentFacts" table="V_IRG_MEMBER_ASSIGNMENT_FACT" inverse="true" lazy="true" fetch="select" cascade="all-delete-orphan"  >
            <key>
                <column name="INCIDENT_DIM_ID_N" precision="22" scale="0" />
            </key>
            <one-to-many class="com.pyramis.cera.hibernate.IrgMemberAssignmentFact" />
        </set>
        <set name="incidentAcctFacts" table="V_INCIDENT_ACCT_FACT" inverse="true" lazy="true" fetch="select" cascade="all-delete-orphan"  >
            <key>
                <column name="INCIDENT_DIM_ID_N" precision="22" scale="0" not-null="true" />
            </key>
            <one-to-many class="com.pyramis.cera.hibernate.IncidentAcctFact" />
        </set>
        <set name="acctAttachmentFacts" table="V_ACCOUNT_ATTACHMENT_FACT" inverse="true" lazy="true" fetch="select" cascade="all-delete-orphan"  >
            <key>
                <column name="INCIDENT_DIM_ID_N" precision="22" scale="0" not-null="true" />
            </key>
            <one-to-many class="com.pyramis.cera.hibernate.AccountAttachmentFact" />
        </set>
    </class>
</hibernate-mapping>

CerSecurityDim.hbm.xml

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!-- Generated Mar 19, 2012 9:24:47 AM by Hibernate Tools 3.3.0.GA -->
<hibernate-mapping>
    <class name="com.pyramis.cera.hibernate.CerSecurityDim" table="V_CER_SECURITY_DIM">
        <id name="cerSecuDimIdN" type="long">
            <column name="CER_SECU_DIM_ID_N" precision="22" scale="0" />
             <generator class="sequence">
                <param name="sequence">CER_SECURITY_DIM_SEQ</param>
            </generator>
        </id>
        <property name="fmrCusipC" type="string">
            <column name="FMR_CUSIP_C" length="30" not-null="true" />
        </property>
        <property name="tckrC" type="string">
            <column name="TCKR_C" length="30" />
        </property>
        <property name="secuNmC" type="string">
            <column name="SECU_NM_C" not-null="true" />
        </property>
        <property name="numOfShrTrdN" type="java.lang.Long">
            <column name="NUM_OF_SHR_TRD_N" precision="10" scale="0" />
        </property>
        <property name="secuGainLossN" type="java.lang.Double">
            <column name="SECU_GAIN_LOSS_N" precision="15" />
        </property>
        <property name="buySellIndC" type="string">
            <column name="BUY_SELL_IND_C" length="10" />
        </property>
        <property name="delIndC" type="string">
            <column name="DEL_IND_C" length="1" not-null="true" />
        </property>
        <property name="updUsrC" type="string">
            <column name="UPD_USR_C" length="12" />
        </property>
        <property name="updTsD" type="date">
            <column name="UPD_TS_D" length="7" />
        </property>
        <property name="insUsrC" type="string">
            <column name="INS_USR_C" length="12" not-null="true" />
        </property>
        <property name="insTsD" type="date">
            <column name="INS_TS_D" length="7" not-null="true" />
        </property>
        <set name="incidentAcctSecFacts" table="V_INCIDENT_ACCT_SEC_FACT" inverse="true" lazy="true" fetch="select" cascade="all-delete-orphan"  >
            <key>
                <column name="SECU_DIM_ID_N" precision="22" scale="0" not-null="true" />
            </key>
            <one-to-many class="com.pyramis.cera.hibernate.IncidentAcctSecFact" />
        </set>
    </class>
</hibernate-mapping>


IncidentAcctFact.hbm.xml

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!-- Generated Mar 19, 2012 9:24:47 AM by Hibernate Tools 3.3.0.GA -->
<hibernate-mapping>
    <class name="com.pyramis.cera.hibernate.IncidentAcctFact" table="V_INCIDENT_ACCT_FACT">
        <id name="incidentAcctFactIdN" type="long">
            <column name="INCIDENT_ACCT_FACT_ID_N" precision="22" scale="0" />
            <generator class="sequence">
                <param name="sequence">INCIDENT_ACCT_FACT_SEQ</param>
            </generator>
        </id>
        <many-to-one name="accountDim" class="com.pyramis.cera.hibernate.AccountDim" fetch="select">
            <column name="ACCT_DIM_ID_N" precision="22" scale="0" not-null="true" />
        </many-to-one>
        <many-to-one name="incidentDim" class="com.pyramis.cera.hibernate.IncidentDim" fetch="select">
            <column name="INCIDENT_DIM_ID_N" precision="22" scale="0" not-null="true" />
        </many-to-one>
       <!--  <many-to-one name="attachmentTypeDim" class="com.pyramis.cera.hibernate.AttachmentTypeDim" fetch="select">
            <column name="ATTACHMENT_TYPE_DIM_ID_N" precision="22" scale="0" not-null="false" />
        </many-to-one> -->
        <property name="relEffFromD" type="date">
            <column name="REL_EFF_FROM_D" length="7" />
        </property>
        <property name="relEffThruD" type="date">
            <column name="REL_EFF_THRU_D" length="7" />
        </property>
        <property name="ltstRelIndC" type="string">
            <column name="LTST_REL_IND_C" length="1" />
        </property>
        <property name="delIndC" type="string">
            <column name="DEL_IND_C" length="1" not-null="true" />
        </property>
        <property name="updUsrC" type="string">
            <column name="UPD_USR_C" length="12" />
        </property>
        <property name="updTsD" type="date">
            <column name="UPD_TS_D" length="7" />
        </property>
        <property name="insUsrC" type="string">
            <column name="INS_USR_C" length="12" />
        </property>
        <property name="insTsD" type="date">
            <column name="INS_TS_D" length="7" />
        </property>
    </class>
</hibernate-mapping>


IncidentAcctSecFact.hbm.xml

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!-- Generated Mar 19, 2012 9:24:47 AM by Hibernate Tools 3.3.0.GA -->
<hibernate-mapping>
    <class name="com.pyramis.cera.hibernate.IncidentAcctSecFact" table="V_INCIDENT_ACCT_SEC_FACT">
        <id name="incidentAcctSecIdN" type="long">
            <column name="INCIDENT_ACCT_SEC_ID_N" precision="22" scale="0" />
            <generator class="sequence">
                <param name="sequence">INCIDENT_ACCT_SEC_FACT_SEQ</param>
            </generator>
        </id>
        <many-to-one name="accountDim" class="com.pyramis.cera.hibernate.AccountDim" fetch="select">
        <column name="ACCT_DIM_ID_N" precision="22" scale="0" not-null="true" />
        </many-to-one>
        <many-to-one name="cerSecurityDim" class="com.pyramis.cera.hibernate.CerSecurityDim" fetch="select">
            <column name="SECU_DIM_ID_N" precision="22" scale="0" not-null="true" />
        </many-to-one>
        <many-to-one name="incidentDim" class="com.pyramis.cera.hibernate.IncidentDim" fetch="select">
            <column name="INCIDENT_DIM_ID_N" precision="22" scale="0" not-null="true" />
        </many-to-one>
         <property name="relEffFromD" type="date">
             <column name="REL_EFF_FROM_D" length="7" />
         </property>
         <property name="relEffThruD" type="date">
             <column name="REL_EFF_THRU_D" length="7" />
         </property>
         <property name="ltstRelIndC" type="string">
             <column name="LTST_REL_IND_C" length="1" />
         </property>
         <property name="delIndC" type="string">
             <column name="DEL_IND_C" length="1" />
         </property>
         <property name="updUsrC" type="string">
             <column name="UPD_USR_C" length="12" />
         </property>
         <property name="updTsD" type="date">
             <column name="UPD_TS_D" length="7" />
         </property>
         <property name="insUsrC" type="string">
             <column name="INS_USR_C" length="12" />
         </property>
         <property name="insTsD" type="date">
             <column name="INS_TS_D" length="7" />
         </property>
    </class>
</hibernate-mapping>


The method where the actual processing is as follows.

   public boolean retrieveDataAndParseFile(IncidentDetailsForm incidentDetailsForm,  BaseViewBean baseViewBean$Session,
                                                ActionMessages errors) throws Exception {
        boolean savedStatus = false;   
        boolean deletedstatus = false;

        /*List<AccountDim> accountsList = new ArrayList<AccountDim>();
        List<CerSecurityDim> cerSecuList = new ArrayList<CerSecurityDim>();
        List<IncidentAcctSecFact> inciAcctSecFactList = new ArrayList<IncidentAcctSecFact>();
        List<IncidentAcctFact> inciAcctFactList = new ArrayList<IncidentAcctFact>();
        List<IncidentDim> incidentList = new ArrayList<IncidentDim>();*/

        try {
            double totalSecGL= 0.00;
            double secTrdNetTotal= 0.00;
            DecimalFormat twoDForm = new DecimalFormat("#.##");

            String loginUser = baseViewBean$Session.getLoggedInUser().getUserId();
            List<Long> addedElementList = new ArrayList<Long>();

            CerSecurityDim cerSecDim = null;
            AccountDim account = null;
            IncidentAcctSecFact iasFact = null;
            IncidentAcctFact iaFact = null;
            long incidentId = baseViewBean$Session.getIncidentDim$Session().getIncidentDimIdN();
            IncidentDim incident = (IncidentDim)incidentDimDao.findById(IncidentDim.class, incidentId);
            ExcelListenerBean beanDetails;

            List<AccountDim> acctList = new ArrayList<AccountDim>();
            List <CerSecurityDim> cerSecList = new ArrayList<CerSecurityDim>();
            List <IncidentAcctSecFact> iasFactList = new ArrayList<IncidentAcctSecFact>();

            for (Map.Entry<Integer, ExcelListenerBean> entry : baseViewBean$Session.getExcelRecords().entrySet())
            {
                beanDetails = entry.getValue();

                //Initialize the net amounts for incorrect trade and correction trade.
                secTrdNetTotal= 0;

                cerSecDim = new CerSecurityDim();
                account = new AccountDim();
                iasFact = new IncidentAcctSecFact();
                iaFact = new IncidentAcctFact();

                //
                Object[] pycisDet = investmentDimDao.getPyCISIdByShrtName(beanDetails.getShortName());
                if(pycisDet != null && pycisDet.length > 0){
                    account.setPycisInstnIdN((Long)pycisDet[0]);
                    account.setGdwIdN((Long)pycisDet[1]);
                    account.setTrdSysShrtNmC(beanDetails.getShortName());
                    if(!addedElementList.contains((Long)pycisDet[0])){
                        addedElementList.add((Long)pycisDet[0]);
                    }
                }

                //
                cerSecDim.setFmrCusipC(beanDetails.getFmrCusip());
                SecurityDim sec = getSecDetailsByCusip(beanDetails.getFmrCusip());
                if(sec != null){
                    cerSecDim.setSecuNmC(sec.getSecuNmC());
                    cerSecDim.setTckrC(sec.getTckrC());
                }else {
                    cerSecDim.setSecuNmC("UNKNOWN");
                    cerSecDim.setTckrC("UNKNOWN");
                }

                //
                cerSecDim.setNumOfShrTrdN(beanDetails.getIncorrectTrdShares().longValue());

                //
                cerSecDim.setBuySellIndC(beanDetails.getIncorrectTrdBuySell().toUpperCase());
                account.setBuySellIndC(beanDetails.getIncorrectTrdBuySell().toUpperCase());

                //
                secTrdNetTotal  = Double.valueOf(twoDForm.format(beanDetails.getIncorrectTrdNet())) +
                                                Double.valueOf(twoDForm.format(beanDetails.getCorrectionTrdNet()));

                //
                totalSecGL = totalSecGL + secTrdNetTotal;

                boolean updatedStatus = false;

                // create the relationship and then add to the respective lists.
                cerSecDim.setInsUsrC(loginUser);
                cerSecDim.setInsTsD(AppGlobalUtil.getCurrentTimeStamp());
                cerSecDim.setDelIndC(AppGlobalConstants.HardCodedValues.No);

                if(!acctList.isEmpty()){
                    for( AccountDim olderAccount :acctList){
                        if(olderAccount.getPycisInstnIdN().compareTo(account.getPycisInstnIdN()) == 0) {
                            double newAcctGainLossAmt=0;
                            double oldAcctGainLossAmt=0;
                            if(account.getAcctGainLossAmtN() != null){
                                newAcctGainLossAmt = account.getAcctGainLossAmtN();
                            }
                            if(olderAccount.getAcctGainLossAmtN() != null){
                                oldAcctGainLossAmt = olderAccount.getAcctGainLossAmtN();
                            }
                            double newGLAmt = newAcctGainLossAmt + oldAcctGainLossAmt;
                            account = olderAccount;
                            account.setAcctGainLossAmtN(newGLAmt);
                            updatedStatus = true;
                        }
                    }
                }

                if(!cerSecList.isEmpty()){
                    for(CerSecurityDim olderCerSecDim : cerSecList){
                        if(olderCerSecDim.getFmrCusipC().equals(cerSecDim.getFmrCusipC())) {
                            cerSecDim = olderCerSecDim;
                            double newSecuGainLoss = 0;
                            double oldSecuGainLoss = 0;
                            if(cerSecDim.getSecuGainLossN() != null){
                                newSecuGainLoss = cerSecDim.getSecuGainLossN();
                            }
                            if(olderCerSecDim.getSecuGainLossN() != null){
                                oldSecuGainLoss = olderCerSecDim.getSecuGainLossN();
                            }
                            cerSecDim.setSecuGainLossN(newSecuGainLoss + oldSecuGainLoss);

                            for(IncidentAcctSecFact olderIASFact : iasFactList){
                                if(olderIASFact != null && olderIASFact.getCerSecurityDim() != null
                                        && olderIASFact.getCerSecurityDim().getFmrCusipC().equals(cerSecDim.getFmrCusipC())){
                                    iasFact = olderIASFact;
                                }
                            }
                        }
                    }
                }
                if(!deletedstatus){
                    deleteAllImpactedAccounts(baseViewBean$Session);
                    deletedstatus = true;
                }
                totalSecGL = Double.valueOf(twoDForm.format(totalSecGL));

                account.setInsUsrC(loginUser);
                account.setInsTsD(AppGlobalUtil.getCurrentTimeStamp());
                account.setDelIndC(AppGlobalConstants.HardCodedValues.No);
                accountDimDao.saveOrUpdate(account);

                iasFact.setAccountDim(account);
                iasFact.setIncidentDim(incident);
                iasFact.setCerSecurityDim(cerSecDim);
                iasFact.setInsUsrC(loginUser);
                iasFact.setInsTsD(AppGlobalUtil.getCurrentTimeStamp());
                iasFact.setDelIndC(AppGlobalConstants.HardCodedValues.No);

                cerSecDim.getIncidentAcctSecFacts().add(iasFact);
                account.getIncidentAcctSecFacts().add(iasFact);
                incident.getIncidentAcctSecFacts().add(iasFact);

                if(!updatedStatus){
                    iaFact.setAccountDim(account);
                    iaFact.setIncidentDim(incident);
                    iaFact.setInsUsrC(loginUser);
                    iaFact.setInsTsD(AppGlobalUtil.getCurrentTimeStamp());
                    iaFact.setDelIndC(AppGlobalConstants.HardCodedValues.No);

                    incident.getIncidentAcctFacts().add(iaFact);
                    account.getIncidentAcctFacts().add(iaFact);
                }
                incident.setTotGainLossN(totalSecGL);

                cerSecurityDimDao.saveOrUpdate(cerSecDim);
                incidentAcctSecFactDao.saveOrUpdate(iasFact);
                if(!updatedStatus){
                    accountDimDao.saveOrUpdate(account);
                }
                if(!acctList.contains(account)){
                    acctList.add(account);
                }
                if(!cerSecList.contains(cerSecDim)){
                    cerSecList.add(cerSecDim);
                }
                if(!iasFactList.contains(iasFact)){
                    iasFactList.add(iasFact);
                }
                if(!updatedStatus){
                    incidentAcctFactDao.saveOrUpdate(iaFact);
                }
                incidentDimDao.saveOrUpdate(incident);

                NumberFormat formatter = new DecimalFormat("#0.00");
                incidentDetailsForm.setTotalGainLoss(formatter.format(totalSecGL));

                savedStatus = true;

                /*accountsList.add(account);
                cerSecuList.add(cerSecDim);
                inciAcctSecFactList.add(iasFact);
                inciAcctFactList.add(iaFact);
                incidentList.add(incident);*/
            }

        } catch (Exception e) {
            logger.error(e.getMessage());
            e.printStackTrace();
            throw e;
        }
        finally{
            baseViewBean$Session.getExcelRecords().clear();
            baseViewBean$Session.setExcelRecords(null);
        }

        /*accountDimDao.saveOrUpdateAll(accountsList);
        cerSecurityDimDao.saveOrUpdateAll(cerSecuList);
        incidentAcctSecFactDao.saveOrUpdateAll(inciAcctSecFactList);
        incidentAcctFactDao.saveOrUpdateAll(inciAcctFactList);
        incidentDimDao.saveOrUpdateAll(incidentList);*/

        return savedStatus;
    }

The dao functions are accessed from another file.

Please let me know how i can increase my performance.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.