Typically you read connection URI from a configuration file or from command line or something similar. Than you check if the user provide correct information for your program. Firstly you try to connect to database. If connection fails you just output something about wrong database URI. But successful connect is not sufficient evidence that your program get correct database to work. User may accidentally give URI from some other database that was spawned for another purposes on the same server. So at the second step you should check if the database holds the intended scheme. It is much more explicit to give just one error to the user like "wrong database specified" than spawn bunch of errors every time you try to query non-existent classes with non-defined fields.
On Monday, August 25, 2014 10:36:19 PM UTC+4, Lvc@ wrote: > > What do you mean? Can you elaborate it? > > Lvc@ > ᐧ > > > On 25 August 2014 20:34, scala solist <[email protected] <javascript:>> > wrote: > >> There is another consideration for scheme checking other than integrity >> check. Database URL is not statically defined inside the application. It is >> provided by user configuration and should be checked as any other user >> input. >> >> >> On Monday, August 25, 2014 10:20:35 PM UTC+4, Lvc@ wrote: >> >>> Hi, >>> With 2.0 we introduced more strict relationship between schema and >>> instances. So in 2.0 when you change type of a property, an integrity check >>> is issued before the change. >>> >>> In 1.7.x each document is validated against its schema, but in 2.0 we >>> made this validation more efficient. >>> >>> Lvc@ >>> >>> ᐧ >>> >>> >>> On 25 August 2014 18:48, scala solist <[email protected]> wrote: >>> >>>> I work with orientdb using java document api in scheme-full mode. After >>>> opening database with docemunt API I want to check if the database >>>> confirms >>>> to a certain class scheme. So all classes needed for the application >>>> should >>>> be defined and should containt certain fields. For now I just fetch all >>>> classes manually and inspect its properties. It seems to be pretty common >>>> task for scheme-full applications. Is there any high-level constructions >>>> that took scheme description in some text format and checks database >>>> metadata against it? >>>> >>>> -- >>>> >>>> --- >>>> You received this message because you are subscribed to the Google >>>> Groups "OrientDB" group. >>>> To unsubscribe from this group and stop receiving emails from it, send >>>> an email to [email protected]. >>>> >>>> For more options, visit https://groups.google.com/d/optout. >>>> >>> >>> -- >> >> --- >> You received this message because you are subscribed to the Google Groups >> "OrientDB" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected] <javascript:>. >> For more options, visit https://groups.google.com/d/optout. >> > > -- --- You received this message because you are subscribed to the Google Groups "OrientDB" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
