You cannot perform SQL transaction using a Pool object directly (because that would imply keeping a connection open and not knowing when to return it back to the pool).
1 2 3 4 5 6 7 8 9 10 11
If you must use these methods, fetch an actual connection first
conn <- poolCheckout(pool) – then call the appropriate
DBI method on
conn. Since you're fetching a connection
from the pool yourself, you must also remember to return it
back to the pool when you're done:
(otherwise, you have a leaked connection).
For simple transactions, consider using
which is safer since it does not require you to fetch and
release the connection yourself.
DBI::transactions() for the original
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.