Announcement

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

    Server-side DSRequest: AllowMultiUpdate and JPA2DataSource

    I want to do a server-side DSRequest on a JPA-Datasource, updating multiple records at once.
    Here is a simple example: For all invoices with invoiceStatus=-2 we want to set the invoiceStatus to 1.
    Code:
    com.isomorphic.datasource.DSRequest request = new DSRequest("invoice", "update");
    
    final Map values = new HashMap();
    values.put("invoiceStatus", 1);
    request.setValues(values);
    		
    request.setCriteria("invoiceStatus", -2);
    
    request.setAllowMultiUpdate(true);
    			
    request.execute();
    I use the "allowMultiUpdate" flag to enable updating multiple records. However the following code does only trigger a select on the database. No update is done, despite there are records matching the criteria.

    Do I use the "setAllowMultiUpdate" in the correct way?

    My datasource looks like this:
    Code:
    <DataSource 
    	ID="invoice" 
    	serverType="jpa"
    	serverConstructor="com.isomorphic.jpa.JPA2DataSource"
    	beanClassName="xyz.Invoice"
    	autoJoinTransactions="true">
    <field name="id" type="sequence" readOnly="true" primaryKey="true" required="true" canEdit="false"/>
    <field name="invoiceStatus" type="integer" hidden="true" canFilter="false"/>
    ...
    </DataSource>
    I'm using SmartGWT PowerEdition Deployment 2013-06-28.

    #2
    Please show the complete server log for the request.

    You need to do this for any issue that involves server functionality.

    Comment


      #3
      This is the log message when executing the code above:
      Code:
      Hibernate: 
          select
              invoice0_.id as col_0_0_,
              invoice0_.invoiceStatus as col_1_0_ 
          from
              T_INVOICE invoice0_ 
          where
              invoice0_.invoiceStatus=?

      Comment


        #4
        Complete server log please, not random snippets.

        Comment

        Working...
        X