JBoss Datavirtualization change OData row limit


With JBoss Datavirtualization it is possible to expose your virtual databases as a REST service. By default when an exposed table has a primary key; Teiid Designer (the development tool used to create virtual databases)  is able to generate a REST service conform the OData protocol. However, the default OData configuration comes with a small limitation. Users are only allowed to do batch operations on your REST service with a limit of 256 rows a time.

In some cases it might be necessary that a user connecting to your OData REST service be able to access more than 256 rows per query. This blog will give a detailed explanation on how to achieve this.


Changing the OData war

This guide assumes you have access to the server that hosts your JBoss Datavirtualization service and that this server is running CentOS or RedHat.

      1. ssh to your server and go to the following folder
        cd $JBOSS_HOME/dataVirtualization/vdb/
      2. Create a backup of your teiid-odata- (version might differ)
        cp teiid-odata- ~/
      3. Unpack the war file with the following command
        jar -xvf teiid-odata-
      4. Edit the WEB-INF/web.xml file with vi or gedit
        vi WEB-INF/web.xml
      5. Change the following line from 256 to your preferred amount. Note: A value of -1 is for unlimited. However, this is not recommended since not every application may be able to handle that.
      6. Save the file stop your JBoss Datavirtualization service in order to update the war file. Depending on your installation it might resemble to the following command.
        sudo systemctl stop jboss-as-standalone
      7. Update the war file with the following command. Note: repacking the war is not recommended, updating it is easier and less prone to errors.
        jar -uvf teiid-odata- WEB-INF/
      8. Start the JBoss Datavirtualization service and check your logs for any errors.
        sudo systemctl start jboss-as-standalone



This concludes this guide, right now you should be able to freely change the row limit on an OData query of a vdb hosted on your JBoss Datavirtualization instance.