Hi, The OJB ODMG DatabaseImpl is only a logical entrypoint. Thus it is safe to use it as a singleton.
cheers, Thomas > -----Urspr��ngliche Nachricht----- > Von: Boris Wang [mailto:wangbo9624@;yahoo.com.cn] > Gesendet: Freitag, 15. November 2002 11:15 > An: [EMAIL PROTECTED] > Betreff: how to deal with org.odmg.Database to make it both > safe and fast > > > Hi All, > > I have checked the java doc of org.odmg.Database, it has a > close() method and it suggest that "Databases must be opened > before starting any transactions that use the database and > closed after ending these transactions." That sounds > reasonable but i have some troubles for my design. > > My general design is that each table has a corresponding > class (call it entity class) whose properties are table > columns. There is also a corresponding 'Manager' class whose > methods are static methods and the purpose of them are to > manipulate the entity class. > > My trouble is that should I open and close the Database > object in each static method in the Manager class. If so, it > looks ugly. If not, shall I maintain a singlton instance of > the Database class for the whole application (I think it will > have some performance issues). > > Any ideas? Thanks in advance. > > Regards, > > Boris > -- To unsubscribe, e-mail: <mailto:ojb-user-unsubscribe@;jakarta.apache.org> For additional commands, e-mail: <mailto:ojb-user-help@;jakarta.apache.org>
