You can't currently achieve what you want.
I don't know what your application looks like, but there's probably something intrinsically wrong with the design, if you're manipulating more than 40 documents at once in a single transaction.
Workaround
For a fast workaround, you'd need, at least, to change your application to do a 40 sized batch inside an atomic transaction. You can use threads for that, but beware of the maxConcurrentTransactions limit and also the OccConflictException
that may occur in some scenarios. You can learn more about that here.
Best approach
To really solve your problem, all transactions should be atomic. Meaning you should open your driver and perform only 1 operation of (INSERT, DELETE, UPDATE) along with eventual SELECTs.
Example in Java:
private final QldbDriver qldbDriver;
public void updateSomething() {
try {
qldbDriver.execute(txn -> {
String select = "SELECT id FROM YourTable WHERE something = 1 AND createdAt = `1649257121113`";
final Result selectResult = txn.execute(select);
if (selectResult.isEmpty()) {
throw new NotFoundException("Something not found");
}
final Integer id = // convert your result into the id
String update = "UPDATE YourTable set something = 2 where id = " + id;
final Result result = txn.execute(query);
});
} catch (final OccConflictException ex) {
throw new Exception("OCC exception updating!");
}
}
Short take on QLDB
Always keep in mind that this is not a relational database. All sorting and calculations should be done at the application side. The benefit of working with this database relies mainly on its history (journal) and its exports.