Have you tried the following?
ArrayList<MyModel> myList = new ArrayList<MyModel>();
while (lines in csv-file left){
assign values to myModel;
myList.add(myModel);
}
Ebean.save(myList);
The problem is probably due to the round-trip delay - you're waiting
for each insert to finish before sending the next.
You should try to split the process up into multiple async threads, so
you're waiting on multiple inserts at any one point in time.
Then it's just a case of finding the optimal number of threads for
your use case...
Ebean also has a transaction batching mode, whereby it gathers a
configurable number of sql statements before sending them all together
in a batch (as opposed to sending each statement individually).
This is a fairly transparent process, so once you've set up a batch,
you should be able to interact with your play/ebean model the same way
you normally do. So in your case, set up the batch, save each item
normally as you add it, then when all done, simply commit and end the
transaction.
Note that I haven't tried this yet - but it is something I'm going to
be looking further into soon.
http://www.avaje.org/static/javadoc/pub/com/avaje/ebean/Transaction.html#setBatchMode%28boolean%29