Having 4000 records on the client side is a bit heavy to my taste, but you could submit it all at once via a REST POSTcall:
@POST @Path("/savedata") @Consumes(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON) public void saveData(List<YourData> yourData){ //do save }
where List<YourData> is a java list object representing your UI5 table data which you send as JSON
Use an ajax POST call, and send your JSON as payload