Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

  • vostapenko
    replied
    Pretty sad, i'm aware of such workaround, but using it will force me to implement up to 10 copies for each datasource - that's ugly=(

    Leave a comment:


  • sabaka
    replied
    This fix is not planned to go to 8.3p branch at all.. but there are work-arounds, which you can implement temporarily if this optimization issue is critical to performance of your app (until you upgrade to 9.0). For example, you could create alternative data source having only those fields you want in "listFetch" operation and fetch data from it without extra joins.

    Leave a comment:


  • vostapenko
    replied
    When the fix is going to 8.3p branch?

    I'm not planning to upgrade to 9.0 version in the nearest future=(

    Leave a comment:


  • sabaka
    replied
    Sorry, my mistake. I didn't read carefully what version you are using. I've checked only development version at different points in time, while you are using 8.3p version.

    So, you should upgrade to 9.0d and download latest nightly build in order to have outputs work properly.

    Leave a comment:


  • vostapenko
    replied
    There's no problem, when ds.xml looks like this:

    Code:
    <DataSource ID="contacts" serverConstructor="spring:EtgHibernateDataSource"
                serverType="hibernate" beanClassName="ru.eurotechnologygroup.etgcrm.server.model.Contact"
                schemaBean="ru.eurotechnologygroup.etgcrm.server.model.Contact" showPrompt="false">
        <operationBindings>
            <operationBinding operationType="fetch" operationId="listFetch" outputs="id,subject"/>
        </operationBindings>
        <fields>
            <field name="id" hidden="false"/>
            <field name="subject"/>
        </fields>
    </DataSource>
    Note, that Hibernate bean contains much more fields.

    But when extra fields (which are not included in outputs) added, extra joins are performed.

    ds.xml with extra fields
    Code:
    <DataSource ID="contacts" serverConstructor="spring:EtgHibernateDataSource"
                serverType="hibernate" beanClassName="ru.eurotechnologygroup.etgcrm.server.model.Contact"
                schemaBean="ru.eurotechnologygroup.etgcrm.server.model.Contact" showPrompt="false">
        <operationBindings>
            <operationBinding operationType="fetch" operationId="listFetch" outputs="id,subject"/>
        </operationBindings>
        <fields>
            <field name="id" hidden="false"/>
            <field name="subject"/>
            <field name="resultName" valueXPath="result/name"/>
            <field name="result" foreignKey="rubSections.id"/>
        </fields>
    </DataSource>
    log
    Code:
    === 2013-01-25 06:15:03,300 [0-12] INFO  RequestContext - URL: '/etgcrm/sc/IDACall', User-Agent: 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:18.0) Gecko/20100101 Firefox/18.0': Moz (Gecko) with Accept-Encoding header
    === 2013-01-25 06:15:03,300 [0-12] DEBUG IDACall - Header Name:Value pair: Host:127.0.0.1:8888
    === 2013-01-25 06:15:03,300 [0-12] DEBUG IDACall - Header Name:Value pair: User-Agent:Mozilla/5.0 (Windows NT 6.1; WOW64; rv:18.0) Gecko/20100101 Firefox/18.0
    === 2013-01-25 06:15:03,300 [0-12] DEBUG IDACall - Header Name:Value pair: Accept:text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
    === 2013-01-25 06:15:03,300 [0-12] DEBUG IDACall - Header Name:Value pair: Accept-Language:ru-RU,ru;q=0.8,en-US;q=0.5,en;q=0.3
    === 2013-01-25 06:15:03,300 [0-12] DEBUG IDACall - Header Name:Value pair: Accept-Encoding:gzip, deflate
    === 2013-01-25 06:15:03,300 [0-12] DEBUG IDACall - Header Name:Value pair: Content-Type:application/x-www-form-urlencoded; charset=UTF-8
    === 2013-01-25 06:15:03,300 [0-12] DEBUG IDACall - Header Name:Value pair: Referer:http://127.0.0.1:8888/etgcrm.jsp?gwt.codesvr=127.0.0.1:9997
    === 2013-01-25 06:15:03,300 [0-12] DEBUG IDACall - Header Name:Value pair: Content-Length:1095
    === 2013-01-25 06:15:03,300 [0-12] DEBUG IDACall - Header Name:Value pair: Cookie:GLog=%7B%0D%20%20%20%20left%3A1032%2C%20%0D%20%20%20%20top%3A222%2C%20%0D%20%20%20%20width%3A825%2C%20%0D%20%20%20%20height%3A703%2C%20%0D%20%20%20%20priorityDefaults%3A%7B%0D%20%20%20%20%20%20%20%20Log%3A3%2C%20%0D%20%20%20%20%20%20%20%20ListGrid%3A3%2C%20%0D%20%20%20%20%20%20%20%20TreeGrid%3A3%2C%20%0D%20%20%20%20%20%20%20%20ResultTree%3A3%2C%20%0D%20%20%20%20%20%20%20%20ResultSet%3A3%2C%20%0D%20%20%20%20%20%20%20%20fetchTrace%3A3%2C%20%0D%20%20%20%20%20%20%20%20ComboBoxItem%3A3%0D%20%20%20%20%7D%2C%20%0D%20%20%20%20defaultPriority%3A3%2C%20%0D%20%20%20%20trackRPC%3Atrue%0D%7D; JSESSIONID=y0ka1zrinpc5; isc_cState=ready
    === 2013-01-25 06:15:03,300 [0-12] DEBUG IDACall - Header Name:Value pair: Connection:keep-alive
    === 2013-01-25 06:15:03,300 [0-12] DEBUG IDACall - Header Name:Value pair: Pragma:no-cache
    === 2013-01-25 06:15:03,300 [0-12] DEBUG IDACall - Header Name:Value pair: Cache-Control:no-cache
    === 2013-01-25 06:15:03,300 [0-12] DEBUG IDACall - session exists: y0ka1zrinpc5
    === 2013-01-25 06:15:03,300 [0-12] DEBUG IDACall - remote user: admin
    === 2013-01-25 06:15:03,302 [0-12] DEBUG XML - Parsed XML from (in memory stream): 1ms
    === 2013-01-25 06:15:03,303 [0-12] DEBUG RPCManager - Processing 1 requests.
    === 2013-01-25 06:15:03,308 [0-12] DEBUG RPCManager - Request #1 (DSRequest) payload: {
        criteria:{
        },
        operationConfig:{
            dataSource:"contacts",
            operationType:"fetch",
            textMatchStyle:"substring"
        },
        startRow:0,
        endRow:75,
        sortBy:[
            "-id"
        ],
        componentId:"isc_EtgListGrid_0",
        appID:"builtinApplication",
        operation:"listFetch",
        oldValues:{
        }
    }
    === 2013-01-25 06:15:03,308 [0-12] INFO  IDACall - Performing 1 operation(s)
    === 2013-01-25 06:15:03,308 [0-12] DEBUG DeclarativeSecurity - Processing security checks for DataSource null, field null
    === 2013-01-25 06:15:03,308 [0-12] DEBUG DeclarativeSecurity - DataSource contacts is not in the pre-checked list, processing...
    === 2013-01-25 06:15:03,308 [0-12] DEBUG AppBase - [builtinApplication.listFetch] No userTypes defined, allowing anyone access to all operations for this application
    === 2013-01-25 06:15:03,308 [0-12] DEBUG AppBase - [builtinApplication.listFetch] No public zero-argument method named '_listFetch' found, performing generic datasource operation
    === 2013-01-25 06:15:03,308 [0-12] INFO  HibernateDataSource - [builtinApplication.listFetch] Performing fetch operation with
    	criteria: {}	values: {}
    === 2013-01-25 06:15:03,312 [0-12] DEBUG HibernateTransaction - [builtinApplication.listFetch] Started new transaction "219453294"
    === 2013-01-25 06:15:03,312 [0-12] INFO  HibernateDataSource - [builtinApplication.listFetch] Query string: select _Contact, result1 from ru.eurotechnologygroup.etgcrm.server.model.Contact _Contact  left outer join _Contact.result result1 order by _Contact.id desc
    === 2013-01-25 06:15:03,312 [0-12] DEBUG SQL - select count(*) as col_0_0_ from Contact contact0_ left outer join rubsection rubsection1_ on contact0_.CResultRSID=rubsection1_.RSID
    === 2013-01-25 06:15:03,317 [0-12] DEBUG SQL - select top 75 contact0_.CID as CID14_0_, rubsection1_.RSID as RSID9_1_, contact0_.CPID as CPID14_0_, contact0_.CCuratorEmplID as CCurato11_14_0_, contact0_.CDateEnd as CDateEnd14_0_, contact0_.CDateStart as CDateStart14_0_, contact0_.CDesc as CDesc14_0_, contact0_.CIsDone as CIsDone14_0_, contact0_.ExecutorEmplID as Executo12_14_0_, contact0_.CIsIncoming as CIsIncom6_14_0_, contact0_.CPriorityRSID as CPriori13_14_0_, contact0_.CIsRemind as CIsRemind14_0_, contact0_.CRemindDate as CRemindD8_14_0_, contact0_.CResultRSID as CResult14_14_0_, contact0_.CSubject as CSubject14_0_, contact0_.CTypeRSID as CTypeRSID14_0_, rubsection1_.RSHIDDEN as RSHIDDEN9_1_, rubsection1_.RSNAME as RSNAME9_1_, rubsection1_.RSNAMEADD as RSNAMEADD9_1_, rubsection1_.RSPARENTID as RSPARENTID9_1_, rubsection1_.RUBID as RUBID9_1_ from Contact contact0_ left outer join rubsection rubsection1_ on contact0_.CResultRSID=rubsection1_.RSID order by contact0_.CID desc
    === 2013-01-25 06:15:03,324 [0-12] INFO  DSResponse - [builtinApplication.listFetch] DSResponse: List with 5 items
    === 2013-01-25 06:15:03,324 [0-12] INFO  HibernateTransaction - [builtinApplication.listFetch] Attempting to commit 0 database update(s)
    === 2013-01-25 06:15:03,324 [0-12] DEBUG HibernateTransaction - [builtinApplication.listFetch] Committing transaction "219453294"
    === 2013-01-25 06:15:03,332 [0-12] DEBUG RPCManager - Content type for RPC transaction: text/plain; charset=UTF-8
    === 2013-01-25 06:15:03,337 [0-12] DEBUG RPCManager - non-DMI response, dropExtraFields: false
    === 2013-01-25 06:15:03,337 [0-12] DEBUG HibernateTransaction - Closing session "219453294"
    === 2013-01-25 06:15:03,337 [0-12] DEBUG HibernateTransaction - Removed transaction "219453294"
    hibernate bean if you need it
    Code:
    @Entity
    @Table(name = "Contact")
    public class Contact implements Serializable
    {
        private Long id;
        private User curator;
        private ContactPerson contactPerson;
        private RubSection priority;
        private RubSection result;
        private RubSection type;
        private Date dateEnd;
        private Date dateStart;
        private String desc;
        private Boolean done;
        private Boolean incoming;
        private Boolean remind;
        private Date remindDate;
        private String subject;
        private User executor;
    
        @Id
        @GeneratedValue(strategy = GenerationType.IDENTITY)
        @Column(name = "CID")
        public Long getId()
        {
            return id;
        }
    
        public void setId(Long id)
        {
            this.id = id;
        }
    
        @ManyToOne(targetEntity = User.class, fetch = FetchType.LAZY)
        @JoinColumn(name = "CCuratorEmplID")
        public User getCurator()
        {
            return curator;
        }
    
        public void setCurator(User curator)
        {
            this.curator = curator;
        }
    
        @ManyToOne(targetEntity = ContactPerson.class, fetch = FetchType.LAZY)
        @JoinColumn(name = "CPID")
        public ContactPerson getContactPerson()
        {
            return contactPerson;
        }
    
        public void setContactPerson(ContactPerson contactPerson)
        {
            this.contactPerson = contactPerson;
        }
    
        @ManyToOne(targetEntity = RubSection.class, fetch = FetchType.LAZY)
        @JoinColumn(name = "CPriorityRSID")
        public RubSection getPriority()
        {
            return priority;
        }
    
        public void setPriority(RubSection priority)
        {
            this.priority = priority;
        }
    
        @ManyToOne(targetEntity = RubSection.class, fetch = FetchType.LAZY)
        @JoinColumn(name = "CResultRSID")
        public RubSection getResult()
        {
            return result;
        }
    
        public void setResult(RubSection result)
        {
            this.result = result;
        }
    
        @ManyToOne(targetEntity = RubSection.class, fetch = FetchType.LAZY)
        @JoinColumn(name = "CTypeRSID")
        public RubSection getType()
        {
            return type;
        }
    
        public void setType(RubSection type)
        {
            this.type = type;
        }
    
        @Column(name = "CDateEnd")
        public Date getDateEnd()
        {
            return dateEnd;
        }
    
        public void setDateEnd(Date dateEnd)
        {
            this.dateEnd = dateEnd;
        }
    
        @Column(name = "CDateStart")
        public Date getDateStart()
        {
            return dateStart;
        }
    
        public void setDateStart(Date dateStart)
        {
            this.dateStart = dateStart;
        }
    
        @Column(name = "CDesc")
        public String getDesc()
        {
            return desc;
        }
    
        public void setDesc(String desc)
        {
            this.desc = desc;
        }
    
        @Column(name = "CIsDone")
        public Boolean getDone()
        {
            return done;
        }
    
        public void setDone(Boolean done)
        {
            this.done = done;
        }
    
        @Column(name = "CIsIncoming")
        public Boolean getIncoming()
        {
            return incoming;
        }
    
        public void setIncoming(Boolean incoming)
        {
            this.incoming = incoming;
        }
    
        @Column(name = "CIsRemind")
        public Boolean getRemind()
        {
            return remind;
        }
    
        public void setRemind(Boolean remind)
        {
            this.remind = remind;
        }
    
        @Column(name = "CRemindDate")
        public Date getRemindDate()
        {
            return remindDate;
        }
    
        public void setRemindDate(Date remindDate)
        {
            this.remindDate = remindDate;
        }
    
        @Column(name = "CSubject")
        public String getSubject()
        {
            return subject;
        }
    
        public void setSubject(String subject)
        {
            this.subject = subject;
        }
    
        @ManyToOne(targetEntity = User.class, fetch = FetchType.LAZY)
        @JoinColumn(name = "ExecutorEmplID")
        public User getExecutor()
        {
            return executor;
        }
    
        public void setExecutor(User executor)
        {
            this.executor = executor;
        }
    }
    If provided log is not enough, please tell, what packages are you interested in and i'll set them to DEBUG?

    Leave a comment:


  • sabaka
    replied
    I've looked this over both with active version and with older one, but cannot reproduce your issue. For me everything works fine - unnecessary joins are *not* included in queries. If the problem still exists, could you provide more information?
    - complete ds.xml file
    - complete request execution log with debug enabled

    just for your information: outputs limitation has nothing to do with foreign keys being declared lazy in Hibernate bean. It just skips all joins that are not necessary to select fields based on outputs setting.

    Leave a comment:


  • vostapenko
    replied
    Thanks, sabaka, but seems like the problem is still present in some way.

    Code:
    <operationBinding operationType="fetch" operationId="listFetch"
                      outputs="id,subject"/>
    id and subject are just simple bean fields (Long and String) no joins should be made.

    Code:
    === 2013-01-18 21:30:02,974 [0-15] DEBUG RPCManager - Request #1 (DSRequest) payload: {
        criteria:{
        },
        operationConfig:{
            dataSource:"contacts",
            operationType:"fetch",
            textMatchStyle:"substring"
        },
        startRow:0,
        endRow:75,
        sortBy:[
            "-id"
        ],
        componentId:"isc_EtgListGrid_0",
        appID:"builtinApplication",
        operation:"listFetch",
        oldValues:{
        }
    }
    === 2013-01-18 21:30:02,974 [0-15] INFO  IDACall - Performing 1 operation(s)
    === 2013-01-18 21:30:02,974 [0-15] DEBUG DeclarativeSecurity - Processing security checks for DataSource null, field null
    === 2013-01-18 21:30:02,974 [0-15] DEBUG DeclarativeSecurity - DataSource contacts is not in the pre-checked list, processing...
    === 2013-01-18 21:30:02,974 [0-15] DEBUG AppBase - [builtinApplication.listFetch] No userTypes defined, allowing anyone access to all operations for this application
    === 2013-01-18 21:30:02,975 [0-15] DEBUG AppBase - [builtinApplication.listFetch] No public zero-argument method named '_listFetch' found, performing generic datasource operation
    === 2013-01-18 21:30:02,975 [0-15] INFO  HibernateDataSource - [builtinApplication.listFetch] Performing fetch operation with
    	criteria: {}	values: {}
    === 2013-01-18 21:30:02,980 [0-15] DEBUG HibernateTransaction - [builtinApplication.listFetch] Started new transaction "257198896"
    === 2013-01-18 21:30:02,981 [0-15] INFO  HibernateDataSource - [builtinApplication.listFetch] Query string: select _Contact, priority1, type2, result3, curator4, executor5, contactPerson6, jurPerson7 from ru.eurotechnologygroup.etgcrm.server.model.Contact _Contact  left outer join _Contact.priority priority1 left outer join _Contact.type type2 left outer join _Contact.result result3 left outer join _Contact.curator curator4 left outer join _Contact.executor executor5 left outer join _Contact.contactPerson contactPerson6 left outer join contactPerson6.jurPerson jurPerson7 order by _Contact.id desc
    === 2013-01-18 21:30:02,981 [0-15] DEBUG SQL - select count(*) as col_0_0_ from Contact contact0_ left outer join rubsection rubsection1_ on contact0_.CPriorityRSID=rubsection1_.RSID left outer join rubsection rubsection2_ on contact0_.CTypeRSID=rubsection2_.RSID left outer join rubsection rubsection3_ on contact0_.CResultRSID=rubsection3_.RSID left outer join suser user4_ on contact0_.CCuratorEmplID=user4_.USERID left outer join suser user5_ on contact0_.ExecutorEmplID=user5_.USERID left outer join ContactPerson contactper6_ on contact0_.CPID=contactper6_.CPID left outer join CA jurperson7_ on contactper6_.CAID=jurperson7_.CAID
    === 2013-01-18 21:30:02,988 [0-15] DEBUG SQL - select top 75 contact0_.CID as CID14_0_, rubsection1_.RSID as RSID9_1_, rubsection2_.RSID as RSID9_2_, rubsection3_.RSID as RSID9_3_, user4_.USERID as USERID0_4_, user5_.USERID as USERID0_5_, contactper6_.CPID as CPID13_6_, jurperson7_.CAID as CAID11_7_, contact0_.CPID as CPID14_0_, contact0_.CCuratorEmplID as CCurato11_14_0_, contact0_.CDateEnd as CDateEnd14_0_, contact0_.CDateStart as CDateStart14_0_, contact0_.CDesc as CDesc14_0_, contact0_.CIsDone as CIsDone14_0_, contact0_.ExecutorEmplID as Executo12_14_0_, contact0_.CIsIncoming as CIsIncom6_14_0_, contact0_.CPriorityRSID as CPriori13_14_0_, contact0_.CIsRemind as CIsRemind14_0_, contact0_.CRemindDate as CRemindD8_14_0_, contact0_.CResultRSID as CResult14_14_0_, contact0_.CSubject as CSubject14_0_, contact0_.CTypeRSID as CTypeRSID14_0_, rubsection1_.RSHIDDEN as RSHIDDEN9_1_, rubsection1_.RSNAME as RSNAME9_1_, rubsection1_.RSNAMEADD as RSNAMEADD9_1_, rubsection1_.RSPARENTID as RSPARENTID9_1_, rubsection1_.RUBID as RUBID9_1_, rubsection2_.RSHIDDEN as RSHIDDEN9_2_, rubsection2_.RSNAME as RSNAME9_2_, rubsection2_.RSNAMEADD as RSNAMEADD9_2_, rubsection2_.RSPARENTID as RSPARENTID9_2_, rubsection2_.RUBID as RUBID9_2_, rubsection3_.RSHIDDEN as RSHIDDEN9_3_, rubsection3_.RSNAME as RSNAME9_3_, rubsection3_.RSNAMEADD as RSNAMEADD9_3_, rubsection3_.RSPARENTID as RSPARENTID9_3_, rubsection3_.RUBID as RUBID9_3_, user4_.USERBLOCKED as USERBLOC2_0_4_, user4_.USERDATEBIRTH as USERDATE3_0_4_, user4_.DID as DID0_4_, user4_.USEREMAIL as USEREMAIL0_4_, user4_.USERFIRSNAME as USERFIRS5_0_4_, user4_.USERLASTNAME as USERLAST6_0_4_, user4_.USERDATELASTREADNEWS as USERDATE7_0_4_, user4_.USERLOGIN as USERLOGIN0_4_, user4_.USERMASKIP as USERMASKIP0_4_, user4_.USERPASSWORD as USERPAS10_0_4_, user4_.USERPHONE as USERPHONE0_4_, user4_.USERPOSTRSID as USERPOS15_0_4_, user4_.USERPATRONYMIC as USERPAT12_0_4_, user4_.USERWARRANT as USERWAR13_0_4_, user5_.USERBLOCKED as USERBLOC2_0_5_, user5_.USERDATEBIRTH as USERDATE3_0_5_, user5_.DID as DID0_5_, user5_.USEREMAIL as USEREMAIL0_5_, user5_.USERFIRSNAME as USERFIRS5_0_5_, user5_.USERLASTNAME as USERLAST6_0_5_, user5_.USERDATELASTREADNEWS as USERDATE7_0_5_, user5_.USERLOGIN as USERLOGIN0_5_, user5_.USERMASKIP as USERMASKIP0_5_, user5_.USERPASSWORD as USERPAS10_0_5_, user5_.USERPHONE as USERPHONE0_5_, user5_.USERPOSTRSID as USERPOS15_0_5_, user5_.USERPATRONYMIC as USERPAT12_0_5_, user5_.USERWARRANT as USERWAR13_0_5_, contactper6_.CPDateBirth as CPDateBi2_13_6_, contactper6_.CuratorEmplID as Curator10_13_6_, contactper6_.CPDepRSID as CPDepRSID13_6_, contactper6_.CPDesc as CPDesc13_6_, contactper6_.CPEmail as CPEmail13_6_, contactper6_.CPFirstName as CPFirstN5_13_6_, contactper6_.CAID as CAID13_6_, contactper6_.CPLastName as CPLastName13_6_, contactper6_.CPTel as CPTel13_6_, contactper6_.CPPostRSID as CPPostRSID13_6_, contactper6_.CPDateRegister as CPDateRe8_13_6_, contactper6_.RegisterEmplID as Registe14_13_6_, contactper6_.CPSurName as CPSurName13_6_, jurperson7_.CABank as CABank11_7_, jurperson7_.CABankSortingCode as CABankSo3_11_7_, jurperson7_.rsbaseid as rsbaseid11_7_, jurperson7_.cabik as cabik11_7_, jurperson7_.CACLOSED as CACLOSED11_7_, jurperson7_.cadatecertificate as cadatece6_11_7_, jurperson7_.CADATEMODIFY as CADATEMO7_11_7_, jurperson7_.CADATEWARRANT as CADATEWA8_11_7_, jurperson7_.CADESC as CADESC11_7_, jurperson7_.caegrulnum as caegrulnum11_7_, jurperson7_.CAEMAIL as CAEMAIL11_7_, jurperson7_.CAENDDATEWARRANT as CAENDDA12_11_7_, jurperson7_.cafax as cafax11_7_, jurperson7_.cafioaccounter as cafioac14_11_7_, jurperson7_.CAFIOPOST as CAFIOPOST11_7_, jurperson7_.cafiopostshort as cafiopo16_11_7_, jurperson7_.CAINN as CAINN11_7_, jurperson7_.CAJURADDRESS as CAJURAD18_11_7_, jurperson7_.cakors as cakors11_7_, jurperson7_.CAKPP as CAKPP11_7_, jurperson7_.RSLegalFormID as RSLegal37_11_7_, jurperson7_.CANAME as CANAME11_7_, jurperson7_.canumcertificate as canumce22_11_7_, jurperson7_.CANUMWARRANT as CANUMWA23_11_7_, jurperson7_.caokonx as caokonx11_7_, jurperson7_.caokpo as caokpo11_7_, jurperson7_.caokved as caokved11_7_, jurperson7_.CAOGRN as CAOGRN11_7_, jurperson7_.CAPASSWORD as CAPASSWORD11_7_, jurperson7_.caphone as caphone11_7_, jurperson7_.RSPOSTID as RSPOSTID11_7_, jurperson7_.CAPOSTADDRESS as CAPOSTA30_11_7_, jurperson7_.userid as userid11_7_, jurperson7_.cars as cars11_7_, jurperson7_.caseriecertificate as caserie32_11_7_, jurperson7_.CASHORTNAME as CASHORT33_11_7_, jurperson7_.casitekors as casitekors11_7_, jurperson7_.CAUSERNAME as CAUSERNAME11_7_ from Contact contact0_ left outer join rubsection rubsection1_ on contact0_.CPriorityRSID=rubsection1_.RSID left outer join rubsection rubsection2_ on contact0_.CTypeRSID=rubsection2_.RSID left outer join rubsection rubsection3_ on contact0_.CResultRSID=rubsection3_.RSID left outer join suser user4_ on contact0_.CCuratorEmplID=user4_.USERID left outer join suser user5_ on contact0_.ExecutorEmplID=user5_.USERID left outer join ContactPerson contactper6_ on contact0_.CPID=contactper6_.CPID left outer join CA jurperson7_ on contactper6_.CAID=jurperson7_.CAID order by contact0_.CID desc
    === 2013-01-18 21:30:03,012 [0-15] INFO  DSResponse - [builtinApplication.listFetch] DSResponse: List with 5 items
    As it can be seen - there are some joins in hql/sql.

    From my point of view, the HQL should look like

    Code:
    select _Contact from ru.eurotechnologygroup.etgcrm.server.model.Contact _Contact order by _Contact.id desc
    This is for v8.3p_2013-01-18/PowerEdition Deployment (built 2013-01-18)

    N.B. All foreign key fields in Hibernate bean declared LAZY.

    Leave a comment:


  • sabaka
    replied
    Yes, it will. Fixes were committed before 01/16.

    Leave a comment:


  • vostapenko
    replied
    Thx a lot. Will 01/16 3.1 build include this fix?

    Leave a comment:


  • sabaka
    replied
    Hibernate outputs problem is now fixed. No more unnecessary joins included in queries.

    Leave a comment:


  • Isomorphic
    replied
    A developer has been assigned to look into this - we will post further news on this thread, probably next week sometime

    Leave a comment:


  • vostapenko
    replied
    I've got another problem connected with lazy-loading.

    operationBinding.outputs correctly excludes fields from HQL query ONLY if it does not contain "foreignKey" attribute.

    A simple example:
    bean
    Code:
    @Entity
    @Table(name = "CA")
    public class JurPerson implements Serializable
    {
    ...
    @ManyToOne(targetEntity = User.class, fetch = FetchType.LAZY)
        @JoinColumn(name = "userid")
        public User getResponsibleUser()
        {
            return responsibleUser;
        }
    ...
    }
    Code:
    DataSource ID="jurPersons" serverConstructor="spring:EtgHibernateDataSource"
                serverType="hibernate" beanClassName="ru.eurotechnologygroup.etgcrm.server.model.JurPerson"
                schemaBean="ru.eurotechnologygroup.etgcrm.server.model.JurPerson">
    <operationBindings>
            <operationBinding operationType="fetch" operationId="listFetch" requiresRole="R_CA_SHOW"
                              outputs="id,shortName,inn,desc,closed"/>
    ...
    <fields>
        <field name="responsibleUser" [b]foreignKey="users.id"[/b]/>
    ....
    results in
    Code:
    === 2013-01-03 12:10:33,249 [0-30] DEBUG RPCManager - Request #1 (DSRequest) payload: {
        criteria:{
        },
        operationConfig:{
            dataSource:"jurPersons",
            operationType:"fetch",
            textMatchStyle:"substring"
        },
        startRow:0,
        endRow:75,
        componentId:"isc_EtgListGrid_0",
        appID:"builtinApplication",
        operation:"listFetch",
        oldValues:{
        }
    }
    === 2013-01-03 12:10:33,249 [0-30] INFO  IDACall - Performing 1 operation(s)
    === 2013-01-03 12:10:33,249 [0-30] DEBUG DeclarativeSecurity - Processing security checks for DataSource null, field null
    === 2013-01-03 12:10:33,249 [0-30] DEBUG DeclarativeSecurity - DataSource jurPersons is not in the pre-checked list, processing...
    === 2013-01-03 12:10:33,249 [0-30] DEBUG AppBase - [builtinApplication.listFetch] No userTypes defined, allowing anyone access to all operations for this application
    === 2013-01-03 12:10:33,249 [0-30] DEBUG AppBase - [builtinApplication.listFetch] No public zero-argument method named '_listFetch' found, performing generic datasource operation
    === 2013-01-03 12:10:33,250 [0-30] INFO  HibernateDataSource - [builtinApplication.listFetch] Performing fetch operation with
    	criteria: {}	values: {}
    === 2013-01-03 12:10:33,254 [0-30] DEBUG HibernateTransaction - [builtinApplication.listFetch] Started new transaction "816321853"
    === 2013-01-03 12:10:33,254 [0-30] INFO  HibernateDataSource - [builtinApplication.listFetch] Query string: select _JurPerson, responsibleUser1, base2, legalForm3, post4 from ru.eurotechnologygroup.etgcrm.server.model.JurPerson _JurPerson  [b]left outer join _JurPerson.responsibleUser responsibleUser1[/b] left outer join _JurPerson.base base2 left outer join _JurPerson.legalForm legalForm3 left outer join _JurPerson.post post4
    while
    Code:
    <field name="responsibleUser"/>
    results in correct query
    Code:
    === 2013-01-03 12:12:18,928 [0-34] INFO  HibernateDataSource - [builtinApplication.listFetch] Query string: select _JurPerson, base1, legalForm2, post3 from ru.eurotechnologygroup.etgcrm.server.model.JurPerson _JurPerson  left outer join _JurPerson.base base1 left outer join _JurPerson.legalForm legalForm2 left outer join _JurPerson.post post3
    From my point of view "outputs" should exactly define which fields should be included in joins no matter what.

    Please, confirm that issue is being processed.

    TY.

    Leave a comment:


  • Isomorphic
    replied
    Two DataSources isn't necessary, set operationBinding.outputs to avoid data being delivered to the browser.

    Leave a comment:


  • alius
    replied
    Hi,

    All fields declared in data source (except with ignore=true) will be initialized.

    To solve your problem I would sggest to have two data sources on the same bean:
    1. for DynamicForm with all fields
    2. for ListGrid only with fields required to show in grid. It should have dropExtraFields=true at data source level.

    Regards,
    Alius

    Leave a comment:


  • vostapenko
    replied
    Thanks a lot, Alius.

    What about other fields, which are not shown in ListGrid (hidden, detail)? Are they being initialized during listgrid fetch?

    And if yes and it works as designed, what's the best practice to overcome this issue?

    For example, i have a huge Lazy Object in my Hibernate bean. I defenetly don't wanna initialize it during listgrid fetch operation (and it's not shown in ListGrid).

    But i want to show it in details view and during record editing in DynamicForm.

    Thanks for your help.

    Leave a comment:

Working...
X