Does Nhibernate support Sybase? - wpf

I'm about to start on a new WPF application with a Sybase datastore. The team has experience with Nhibernate, but we are not really sure how well it supports Sybase and if there are some major pitfalls we should look out for.
If yes, how about Fluent nhibernate?
If not, do you know any other ORM products that we could use for Sybase in this scenario?
Thanks.

Sybase is officially supported in NHibernate.
From what I've seen, Fluent NH doesn't expose a class for configuring a Sybase DB, but you can probably do that in a just couple of lines (the rest of it is not dependent on the DB)

Are you asking about Sybase ASE or Sybase Anywhere. NHibernate supports both and FluentNHibernate supports neither.

I'd like to correct the statements made here, even though this is an older post. NHibernate does NOT exactly support Sybase.
As a reference for why I say this statment please look here:
http://community.jboss.org/wiki/DatabasessupportedbynHibernate
Granted that post is from 2009. NHibernate has since released version 3.0 which does have dialects available for Sybase:
http://nhforge.org/blogs/nhibernate/archive/2010/12/05/nhibernate-3-0-released.aspx
But the issue here is it is only for Sybase Anywhere, so if you have ASE you will have to refer to Glenn Paulley's independent releases for NHibernate, and I do not believe he is actually affiliated with NHibernate.
All this being said, I've tried for the past few hours to get what is out there working with Sybase ASE 15 and I've been unsuccessful. Looks like I'll just make my own with the .NET drivers provided.

According to this link, I would say that it does. There seems to have known issues, though. But depending on what you need, it might suit your needs.
The SQLAnywhere12Dialect seems to have repaired some of the buggy stuff.

To follow up on Joseph's answer:
I downloaded the binaries for NHibernate 3.2.0.GA about two weeks ago (about 10/5/2011) and it didn't seem to come with ASE 15 support out of the box (no dialect or drivers, closest one maybe being SQL Anywhere).
This issue was reported in their Jira.
Today (10/20/2011) I downloaded the source code for the project to try to add my own and I found out that there are classes now that offer this support, SybaseASE15Dialect.cs and SybaseASEDriver.
I'm not sure if the binaries now have this support, but if not you can just download the source files, build the NHibernate project and use the dlls, or just wait until they make a new release with this.

I've done a similar project using NHibernate, and using ODBC to connect to Sybase SQL Anywhere, it works fine with the "GenericDialect".
Here's some sample code to build your session factory.
var mapper = new ModelMapper();
mapper.AddMappings(Assembly.GetExecutingAssembly().GetExportedTypes());
HbmMapping mapping = mapper.CompileMappingForAllExplicitlyAddedEntities();
NHibernate.Cfg.Configuration cfg = new NHibernate.Cfg.Configuration()
.DataBaseIntegration(db =>
{
db.ConnectionString = connectionStr;
db.Dialect<NHibernate.Dialect.GenericDialect>();
db.Driver<NHibernate.Driver.OdbcDriver>();
});
cfg.AddMapping(mapping);
cfg.BuildSessionFactory();

Related

Why is SQLServerDriver gone from Slick 2.0.0-M3 to Slick 2.0.0?

I was using Slick 2.0.0-M3 in my project and just upgraded to Slick 2.0.0
ScalaDoc (2.0.0-M3): http://slick.typesafe.com/doc/2.0.0-M3/api/index.html#package
SaclaDoc (2.0.0): http://slick.typesafe.com/doc/2.0.0/api/#package
In the former, the SQLServerDriver Trait is available, whereas in the latter it is gone. Can someone tell me where to optain it again?
Support for non-open-source databases including SQL Server is available as part of the commercial slick-extensions offered by Typesafe. More info here: http://slick.typesafe.com/doc/2.0.0/extensions.html
As of Slick 2.0.0, the SQL Server driver (being a non-open-source database) is not open source any more.
Also you may want to check Freeslick

cakephp, linux & mssql

This question has been asked here a number of times, but I have never found a correct solution.
Basically cake 2.x moved to PDO, effectively dropping support for MSSQL on Linux.
Our existing implementation using FreeTDS and CakePHP 1.3.14 worked fine. Now that I've almost completed the upgrade to 2.4.2 the Mssql support for Linux is a big pain.
The code we have actually connects to both MySQL and MSSQL databases.
My options are:
1) Move to a Windows server, which I don't want to do.
2) Port over the Odbc.php from cake 1.3 into cake 2.4.2 and use that instead
3) Try and hack up Sqlsrv.php (or extend it) and use dblib (sybase) to connect
4) Use the Datasource plugin (branch mssql-2.0). Kind of works, it extends DboSource.php but doesn't implement a number of things properly.
So, not sure where to go from here. Would love to get a hacked PDO solution working.
Anyone in this situation got a resolution?
Searching for the same problem, I came across a post in Nabble that has links to a Linux native ODBC driver for MSSQL recently released by Microsoft.
This may come in handy: http://cakephp.1045679.n5.nabble.com/SQL-Server-Linux-and-CakePHP-2-tp5463357p5464129.html

Any node.js relational database bindings for Windows?

I'm trying to build a RESTful internal web server at work using node.js, where I'm currently restricted to using a Windows 2003 Server.
I've hit a stumbling block with regards to database support however. Are there any bindings currently available for reading and writing to sqlite, PostgreSQL or MySQL on Windows based machines?
Mariano has mentioned Windows support in the future in these comments, but ideally I'd like to use something available just now as a proof of concept.
I'm author of mysql-native.
Both official (felixge node-mysql) and my driver has been successfully used under windows,
I'm using and developing it under linux/windows 50/50% time . Feel free to contact me if you have any questions
Have you tried mysql-native? It's native (mysql) which means there are no other dependencies, so should run on any platform node supports. Seems to be actively maintained also, and has some examples to show you how to use the library. Link: https://github.com/sidorares/nodejs-mysql-native

Apply upgrades (application related) to database

Since I've not done this before I am not sure if the way I am planning to do this is okay or is there a better way. Like using Windows Installer or Install Shield or Windows Installer XML (WiX) toolset. Any help would be great, as I have no clue.
We have a product and we ship new version every few months. So far we've only been rolling out complete versions i.e. Either Version 1.0, or Version 1.5, but no upgrade from 1.0 to 1.2 to 1.3 to .... you get the picture, right! So any customer that get version 1.0 cannot upgrade to version 1.2 or 1.3 or even the latest. They'll have to uninstall old version and install the latest version. This is not right, but thats what we could do until now. But we'd like to change it.
My plan is to have a install file with (Sql Scripts) for each upgrade path. Check the table in database that stores the version info and depending on it run different script to upgrade database.
My concern is that this method may not be scalable, once we have more than 5 or 6 different versions.
If you could point to any articles or books on this topic, that would help a lot too.
Also, could we use Windows Installer or Install Shield for this?
thanks,
_UB
We've been using DBGhost for a year or so now to keep our database under source control along with our codebase, and it makes this kind of thing dead easy. It's not just well thought through, but they've been using it to roll out their own code for years, so it's dead solid.
Your problem is a pretty common one, and I've had to deal with this kind of problem at my last job. There is another tool aside from the RedGate tool that may help you do what you need to do. It's a tool called DB Ghost. They explicitly address the versioning problem, and have a packager as well. I would suggest doing a trial of the DB Ghost product because they have some interesting claims concerning multiple version upgrades. This was taken from their FAQ (http://www.innovartis.co.uk/faqs/faqs.aspx):
Q: Our problem is going to be managing
data structure changes during
upgrades. Our product line is
Shrink-Wrapped, or downloadable from
the website. So when a user downloads
an upgrade, they can be upgrading from
a very recent version, with few
database structure changes, or the
upgrade may be from a very old version
with a multitude of structural
changes. One upgrade needs to manage
it all. The user would be offsite, so
we can't hold their hand. We have
users in Greece, Australia, Malaysia,
Norway, etc. How would DB Ghost, if at
all, handle updates in remote
locations?
A: The DB Ghost Packager Plus product was
design to specifically address this
issue as it can dynamically handle the
required updates to a target database
seamlessly.
I'm just mentioning this because our company is trying to do something similar and I was doing research on this tool.
Thanks,
Eric
Do you insist on doing it yourself, or could you see yourself committing and investing in a tool?
I really like the idea of Red-Gate's SQL Packager, which will "diff" your two database versions, and then create a SQL script, a C# project, or a stand-alone executable to upgrade from version 1 to version 2.
Not 100% how you'd be able to upgrade from 1.0, 1.1, 1.2, 1.3 all to 2.0 - check out their website and see if they offer something for that scenario!
Otherwise, I guess it'll get quite thorny and messy......
Marc
In the Rails world they are using a tool/method called Migrations.
Basically is boils down to creating a small sql script to upgrade and downgrade each little change to the database.
When you are testing the application you migrate your database to the version you want and on deployment the application can check what version it needs and migrate to that version.
There are free migration toolkits for most popular languages, they might be part of some MVC framework though.
A nice side effect of migrations is that you have database source code that is easily stored in you source control repository.

Bugzilla Reporting

Is there a really good free tool for BugZilla reporting? I am finding the default search options on the web interface far too limiting. My biggest issue is with the lack of Order By options (only 1 field at a time, and a very limited set of fields to choose from). I have done some Google searches, but I can't find any good free BugZilla reporting tools.
If there isn't one, can someone please point me to an example on how to access the BugZilla web services? If I can get the BugZilla data, then I can easily build my own reports that will better meet our needs.
Take a look at this: http://www.faqs.org/docs/bugzilla/dbdoc.html
Use this database schema for reference: faqs.org/docs/bugzilla/dbschema.html
If you need a web-interface, use your favorite dynamic website scripting language that can access MySQL databases (say PHP)...
Simple-ish Tutorial: freewebmasterhelp.com/tutorials/phpmysql/4
PHP MySQL API Reference: php.net/manual/en/ref.mysql.php
Then use SQL queries such as:
"SELECT * FROM bugs WHERE WHERE bug_status != 'RESOLVED' ORDER BY creation_ts ASC, votes DESC LIMIT 50"
which lists first 50 entries of unresolved bugs ordered first ascending creation time then descending by number of votes.
I have used this in the past and have liked it a lot: http://www.mediawiki.org/wiki/Extension:Bugzilla_Reports
You can also consider other tool eg mantis
(http://www.mantisbt.org/)
I've personally switched from Bugzilla into Mantis and installed some plugins (http://deboutv.free.fr/mantis/) and found this more comfortable
If you are a Java user, you might want to check out Mylyn for eclipse. This is integrates a task-driven development approach into eclipse.
With that, you can raise bugs, tie together SVN changes and bugs, and hide classes that are not relevant to fixing bugs, etc. It's a bit involved to get started with, but quite powerful.
It also comes with a connector for BugZilla. See this introductory article for an example.
If you don't use eclipse, but you do use Java, then note that since Mylyn is open-source, you might want to look at the source code of the Mylyn BugZilla connector for how they do their work.
Good luck.
You can try Deskzilla (http://deskzilla.com/) - it is a multi-platform desktop client for Bugzilla with Outlook-like interface, rich reporting and filtering capabilities, offline work, drag-n-drop, etc. It's a commercial product, but if you're working on an Open Source project you can use it for free.
AFAIK Bugzilla uses MySQL database for storing data. So probably you can connect with some visual db manager (plenty of it exists, see Toad Data Modeler, DbVisualizer) and try do do some sql work...
There is a list of some add-ons (free and commercial) listed on the Buzilla addons wiki.
If you are a Windows user, MyZilla is a possible option.
Otherwise, to work toward your own, see the Bugzilla API documentation, which, in a way, includes how to retrieve the current schema (Bugzilla::DB::Schema), and Bugzilla::WebService.
Netbeans also has Bugzilla integration (I haven't tried it...).
I have analized a bunch of bug tracking tools.
You can try track or mantis, because bugzilla is very unfriendly about reporting.
Mantis
Mantis can export data in excel: all the graphic you need can be generated by that sheet.
For more information take a look to my blog:
http://gioorgi.com/2008/bug-tracking-mantis/
Anyway, Track is used a lot more, so for sake of completeness I should cite it:
Track
Pros:
Can Also work with an embedded database (using sqlite).
Easy to setup and use.
Cons:
Feature are too much, and aims to be also a CMS to some extend.
Take a look to:
http://gioorgi.com/2008/bug-tracking-trac/
Since Bugzilla can be installed on your own server, I presume the simplest way is to do that and play with the databases it creates ("Bugzilla supports MySQL, PostgreSQL and Oracle as database servers"). The documentation also says you can modify the templates as you like.
Otherwise one could try paid support or some other bug trackers.
I use this bookmarklet and like how it searches right with the strings entered in the location bar like smart search. It lets you quickly search bugzilla or jump to a bug number via Bugzilla Quicksearch, and is IE6+, Moz, Op7+ compatible.
Its companions on the same page can be used to refine or help with bug search/report, e.g. collect buglinks (queries bugzilla to show a list of bugs linked to from the current page),ord buglinkify (turns all numbers on the page into bug links).

Resources