Article
TransactionTooLargeException and a Bridge to Safety — Part 2
December 18, 2019

In the first article of this series , I discussed what TransactionTooLargeException
is, when and why it happens, and how the Bridge
library can be used to avoid the problem. If you are not yet familiar with how to use Bridge
you should definitely check out that article before continuing. What I’d like to do now is to take a peek inside the library itself and focus on a few tricks used to make it all work. First, though, we have a bit of bookkeeping to discuss.
A quick look at the documentation will show that all the interactions with Bridge
take the form of static method calls: Bridge.saveInstanceState
, Bridge.restoreInstanceState
, etc. However, there is very little actual code in the Bridge
class itself. Apart from checks to make sure the initialize
method has been called, each static method simply calls through to a static instance of a different class, BridgeDelegate
: