You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-user@db.apache.org by Jonathan Purvis <jo...@netvalue.net.nz> on 2008/09/24 07:03:06 UTC

resetting IDBroker?

Hi,

As part of our unit tests for our application that uses Torque we have 
an H2 database that runs in memory.  Each test shutdowns down Torque, 
recreates the database from an SQL script and restarts Torque.  Even 
though the ID_TABLE is reset, the IDBroker still remembers the old 
values it had cached.  I solved this by adding these lines to the stop() 
method in IDBroker.java:

         ids.clear();
         quantityStore.clear();
         lastQueryTime.clear();

Is there a better way of doing this?


Regards,

	Jon

---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Re: resetting IDBroker?

Posted by Thomas Vandahl <tv...@apache.org>.
Jonathan Purvis wrote:
>         ids.clear();
>         quantityStore.clear();
>         lastQueryTime.clear();
> 
> Is there a better way of doing this?

Probably not. I guess this is another part that I forgot when trying to
fix Torque's life cycle. Would you please open a JIRA issue for this.

Bye, Thomas.


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org