I'm not sure I understand the questions here, but the ESB itself uses queues (DLQ, etc) and the EPR data stored jUDDI also needs a datasource.
The administration guide has details on most of the the components you are asking about, give it a look.
1.4. Database Configuration
The ESB uses a database for persisting Registry services, and the Message-Store.
what kind of situation ESB would persist messages into database automatically?
Actually, when ESB server would insert messages into table of message?