|Subject||Re: Re: [IB-Architect] Re: New API -- Request for Comments|
> >A. Why should we really need a driverManager à la JDBC ? I'm sure I missimplemented
> >some big point here. Isn't this API supposed to "connect" / be
> >by relying on the existing C-API ?Understood.
>We don't. Unlike ODBC, which is an intermediary for all calls, Jdbc's
>driver manager exists only to provide polite introductions between
>a client and a driver. The client takes directly to the Connection
>object and his henchmen leaving the driver manager in the dust.
>For the time being, I'm not using a driver manager at all. The
>mechanism to connect to a driver is to load the driver, lookup
>the entrypoint "checkConnection()" and call it.
>If I ever learn to like XML, I'll make a driver manager use itpractically
> >B. I do not like the concept of "multiple transactions" means "multiple
> >attachments". Even if this is needed to be "JDBC"-like. I agree a kind of
> >attachment handle sharing through a sort of clone() method gives
> >the same kind of results, but I think some other object is required todatabases
> >encapsulate the transaction. IMHO, it's cleaner and at least it gives a
> >coherent solution to handle distributed transactions. With the current
> >proposal, how would you write a sample program connecting to two
> >and starting a two-phase commit transaction to update things in bothOkay. For now, I only suggest that the connection.clone() method be
> >databases ?
>Yeah. I tend to agree with you. If Sun had asked my opinion, Jdbc
>would have been a little different.
>That said, a Connection is, more or less, a transaction. Adding
>Connection::clone() would give a perfectly serviceable transaction
>capable of sharing the database connection (for the one and only
>database that supports multiple transaction per process).
>Some thought definitely needs to be given for a two phase commit.
>Complicating the issue is that there are two competing standards
>to cross subsystem two phase commits. Even worse, the better of
>the two is Microsoft's.
>I did a little design work a year ago on the problem that I should
>dig up. I think it important that the hooks be good enough to
>plug into industry standard solutions that inventing something
>not quite good enough.
implemented from day one of your first release. Even if it is of no use for
ODBC implementation, it is really important for other kind of application
softwares written with your API.
> >C. "Connection *connection = createConnection();"to
> >So you prefer to ban things like "Connection* connection = new
> >Connection();" ?
> >Or "Connection connection;" ?
> >Anyway, we at least require some releaseConnection() or freeConnection()
> >free resources, then.Good point and design.
>First, that won't compile because Connection is an abstract class --
>it is a pure interface with no code behind it. The actual Connection
>object will be a subclass of Connection substantiated by a Jdbc
>driver/subsystem. Since the client program can't be compiled against
>the real thing, it has to call somebody to create the actual object.
> >D. getByte, getInteger, and the like : how can I check if the field isSQL
> >NULL or actually returned a data ?So I have to call wasNull() after each get() ?
>ResultSet::wasNull() returns true/false.
And that call to wasNull() gives me an answer related to the previous get()
Sounds a little bit tricky, isn't it ?
> >E. Naming convention : types like Blob, Int, Long, and so on may tooeasily
> >conflict with other unrelated classes when used in a quite large project.C++
> >Maybe some common prefix to each class name, type name. Or rely on the
>Tell me about. I just spent a couple of dreadful days cleaning the
>interfaces out of existing implementation code.
>But, this really isn't a problem since the #include "Connection.h" can
>reside inside a namespace within the client code. We really don't
>have to solve this problem.
> >I can't comment on class DatabaseMetaData, I'm JDBC deficient, for now.Olivier Mascia
>An earlier draft of Jdbc had a single function to indicate Jdbc
>compliance -- boolean valued. It seems to have gotten lost. Problem
>went with the smart JavaSoft guys when they joined the real world to