Dear Mariano,
What are the advantages of OpenDBX vs ODBC? How is the integration with Pharo? Glorp? Are there examples for ms sql server ?
Thanks in advance,
Claudio Campos
Hi! What an excellent question. However, I have to admit I never used ODBC squeak driver.
I hope you wanted to said SqueakDBX instead of OpenDBX :) I guess you are a Smalltalk programmer. Actually, we (SqueakDBX) has advantages over other drivers and also, OpenDBX has over other libraries.
1) First, I will copy paste a piece of text from OpenDBX webpage: "Contrary to interfaces like ODBC, the OpenDBX library favors speed and flexibility and therefore doesn't try to unify the SQL query language. It enables the application developer either to use only standardized SQL elements or to utilize more efficient database specific language elements as well. Furthermore, this approach allows adding support for databases which don't implement SQL as query language. "
2) OpenDBX supports: Firebird, Interbase, MS SQL Server, MySQL, Oracle, PostgreSQL, Sqlite, Sybase ASE and ODBC. As you can see, OpenDBX has ALSO a ODBC backend.
3) OpenDBX compiles in Linux, Windows and Mac (not only windows)
4) With OpenDBX you don't need (except you use the ODBC backend) external configuration as you need when using ODBC (datasources and all that stuff).
5) This is one of the most important: SqueakDBX, as ODBC, uses FFI to communicate to external functions. As you may know when you call a function with FFI, the COMPLETE VM is locked until the function returns. Suppose that function is the one that process a query. And suppose you have a WebApplication running in your Squeak. You will lock ALL the VM to ALL users until the query is done. This can be very very bad. OpenDBX (when possible) uses asynchronous queries and has a timeout to retry the query to see if it is done. But this wait is in Squeak, not in C. So, if there are other request waiting, the scheduler will process them. So, the time the VM is lock is shorter than in ODBC.
6) I don't why you want to use ODBC but do you want to write SQL by hand? We don't :) Glorp is an ORM for Smalltalk. This is actually for VW and unfortunately, the Squeak port only works on PostgreSQL. We are modifying it and integrating Glorp with SqueakDBX. So, you will be able to use an ORM for all backends. For more information, read: http://www.esug.org/Promotion/SummerTalk We hope to have this integration by the end of the year. Right now we have a proof of concept working with Glorp and SqueakDBX for PostgreSQL :)
7) We have 90 unit tests that are run for every backend.
8) Lots of benchmarks and comparison with native drivers (PostgreSQL and MySQL). We don't have benchmarks comparing to ODBC but I would love to have. If you do something, please send your results.
9) SqueakDBX is very well documented. You can see our wiki page: http://wiki.squeak.org/squeak/6052 In addition, we are creating our own seaside webpage, but it is not ready right now.
10) We have several features like:
- Transactional concept: begin transaction, commit and rollback - Mappings from String to specific types in selects - Special OpenDBX options: multistatements, encryption, compression, paged results, mySQL modes, and more - Automated database connection release (although manual disconnection is recommended ;-) - Automated results retrieving in order to do another query, after doing a query and not iterating ALL results - Error handling: Not only errors, but levels associated with an error in order to avoid FFI calls (if you get a fatal error, it has no sense to do another query and the resources must be free). - Query timeout (this is very useful for webapplications) and pageSize can be set for each query.
Obviously, we have our drawbacks: We don't support large objects (blob, clob, etc..) yet neither Stored Procedures or functions (altought we support multistatements). We also have little "production" uses of SqueakDBX, as it is relative new.
You other questions:
Yes it works perfectly well in Pharo. Actually, half of the team uses Pharo for the development and the other half, Squeak. We are also the one that makes Glorp to work on Pharo. See my email in Pharo list: http://n2.nabble.com/-ANN--Glorp-now-load-easily-in-Pharo-td3056236.html#a30...
You see an example, I would read the getting started in here: http://wiki.squeak.org/squeak/6061 All the examples there work for all backends (they work for mssql). This is the interesting things: the code is exatly the same to all backends. The only thing it could change is the sql written (if you wrote vendor specific sql).
That's all I imagine right now.
If you have further questions, please ask.
Best,
Mariano
On Mon, Jul 6, 2009 at 7:17 PM, Claudio Campos claudio.sistemica@gmail.comwrote:
Dear Mariano,
What are the advantages of OpenDBX vs ODBC? How is the integration with Pharo? Glorp? Are there examples for ms sql server ?
Thanks in advance,
Claudio Campos
SqueakDBX mailing list SqueakDBX@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/squeakdbx
squeakdbx@lists.squeakfoundation.org