spring - When is the database informed about a transaction from Java? -


i'm interested in knowing when java communicate database transaction has been created. when setting autocommit false in jdbc or creating @transactional method in spring, when communication database occur inform of transaction change?

a little background question: have method called billions of times:

@transactional void adddata(object[] data); 

now method doesn't persist data database stores in buffer. when buffer overflows, method flushes data database in batch update.

this means if method called billion times - persists data database hundred thousand times or so. mean every call of method spring contact database create savepoint or begin transaction or something? or information piggied on first flush database?

my concern not want method cause 2 billion database requests transaction status update (one transaction start, 1 transaction end).

also transaction commit (in sense of actual database request) occur if no data flushed database?


Comments