Some PreparedStatements and ResultSets are not closed in the addLink() and exists() methods from TableReference.
Add a finally clause to close these connections to the database avoid errors while exceeding the amount of connections opened to the database.