Friday, September 26, 2008

Advantage Database Server History

ads_ver2Advantage Database Server turned 15 years old this year. The first public release of Advantage, version 2.0, was released in August 1993. I started working with Advantage back in 1999 in the Technical Support department. At that time Advantage version 5.5 was the current release and version 5.6 was in beta. The R&D team was hard at work developing an OLEDB provider for Advantage so I had the opportunity to do a lot of testing with this new Advantage client.

Advantage Database Server started out as DBXcellerator which was a hardware solution designed to speed up the process of creating clipper indexes. It quickly evolved into a software product earning a patent for an Xbase Transaction Processing System.

Version 2.0b was the first publicly available release and was called Advantage Xbase Server which ran on Netware and supported Clipper clients. This continued through the 3.x releases.

With the release of Advantage 4.0 the name was changed to Advantage Database Server and new clients were introduced. An ODBC driver and a native client for Visual Objects were included with version 4.0. In early 1997 the first version of Advantage for Windows was released. Advantage version 4.21 ran on Windows NT 4.0 as a service. Shortly after that the first Advantage Internet Server (AIS) was released as a separate application which allowed for secure connections over the Internet. AIS also earned a patent for One Pass Security.

The Advantage Client Engine (ACE) was released with version 4.4 of Advantage as version 1.0. This included the first version of the TAdsTable component for Delphi 3. This release also included a 32-bit ODBC driver and the Windows Comm Layer. ACE also included several header files for use in various development environments.

Advantage 5.0 included version 2.0 of all the ACE based clients and support for TCP/IP on Netware was added in version 5.1. Advantage introduced our native SQL engine, called StreamlineSQL,  in version 5.5. A native Crystal Reports Driver was added in early 2000 and the ODBC driver was updated to use the native SQL engine. Advantage Data Architect, which was originally available as an example project, was updated and added as an official product in version 5.7.

The Data Dictionary was introduced in version 6.0 which added support for many relational features. The Advantage Internet Server functionality was added to the server removing the need to use a separate application to connect securely over the Internet. All of the Advantage clients were renumbered so the client version matched the server version to eliminate confusion. The first Advantage Database Server for Linux was released in version 6.11 in 2002. We also released a client for Kylix for creating Linux client applications.

Since then we have added many more relational features including; Full Text Search, Replication, Online Backup, SQL UDFs and Notifications. New clients were added including; PHP, DBI/PERL, JAVA and .NET. In an attempt to consolidate this history I put together a timeline using TimeToast which provides a timeline of Advantage releases since version 2.0b. I hope to update the timeline with more pictures and events when I can get them compiled. You can view the full size timeline here.

Wednesday, September 24, 2008

Using Merge with Replication

Replication was enhanced in version 9.0 to include an option for using SQL MERGE statements when performing a replication. The MERGE statement defines an UPDATE and INSERT statement which allows for the appropriate action to be taken. When matching records are found they are updated if a match is not found a new record is inserted.

In the past if a record that did not exist on the Subscriber(server receiving changes) was updated it would return an error.  Any replication errors will prevent further updates from being sent to the Subscriber until the error is resolved, by default. Changes will continue to be queued up but will not be sent to the Subscriber. All replication errors are logged with the error class 7600 in the Advantage Error Log making them easier to locate.

You can ignore all replication errors by specifying the “Ignore Replication Failures” option on the Subscription. This will simply skip records which generate an error on the Subscriber when replicated. You can also define a custom set of errors by setting the PERMITTED_REP_ERRORS configuration parameter (Advantage 8.1 and newer). Simply provide a comma (,) separated list of error numbers to be allowed, ensuring replication continues.

A MERGE statement can be used on replication INSERTS and UPDATES. You enable the use of MERGE statements in the Publication properties dialog (shown below). These are independent of each other so you can select none, one or both of these options. MERGE statements are not used by default.

PublicationSetupThis option can be used to assist with setting up replication to another Subscriber. By using MERGE statements for UPDATEs any record which does not exist at the Subscriber will be added to the table. This means you can put a copy of your database on the Subscriber which does not have any data in the tables, the table structure must exist on the subscriber. The next step is to update every record on the Publisher to insert all the records on the Subscriber.

You can do this with an SQL statement which does not change the data such as: UPDATE <table> SET <field> = <field>. For more details on this refer to this KB Item. It describes the process and provides code for a UDF which performs an UPDATE on every table in the database which would replicate all the records to the Subscriber(s).

Monday, September 22, 2008

We Want Your Feedback

Many of the features we have included in Advantage over the years have been the result of user feedback. We get most of our user feedback at our product direction sessions at the Advantage Technical Summit and European Advantage Conference. Our unequaled technical support team also collects suggestions which they forward on to the R&D team.

We will continue to collect feedback in all of these ways but now we have a more direct way for you to provide your feedback. We have a feedback site which allows you to vote for the features you would like to see in the product*.

The feedback site allows you to see, add, vote for and discuss suggestions. Suggestions which are accepted by the R&D team will be tagged with a “Started” or “Planned” flag.

You get 10 votes which you can assign to any suggestions you want. As suggestions that you have voted for are completed you get your votes back to apply to new suggestions. If you have already added or voted for suggestions thank you! If not visit the site and take a look at what other Advantage users would like to see.

* The product roadmap, features, enhancements, timelines and dates discussed on the feedback forum are forward looking and are subject to change. Sybase iAnywhere retains sole discretion as to when, if ever, discussed enhancements will occur.

Friday, September 19, 2008

Advantage Supported IDEs

I frequently get asked about which development environments Advantage Supports. I always start with the major ones Delphi, Visual Studio and Java. We also support many other environments such as Visual Objects, Clipper, PHP, Perl/DBI, C++ and Crystal Reports. The next question often times is which version of <development environment> is supported.

I try really hard not to answer the question with a question, for example “Which version of <development environment> are you currently using?”, so I try to answer with “We support version x through y of <development environment>. Most of the time I remember which version but sometimes I have to look it up. So in an effort to make this question easier I built a matrix of the supported clients.

The Advantage version is listed along the top and the development environment is listed down the left side. I did not include the generic clients; OLEDB, ODBC, JAVA, PHP since these are included in all of the Advantage versions listed.






Delphi 3 – 8 (TDataSet) Y Y Y N1
Delphi 2005 Y Y Y N
Delphi 2006 & 2007 Y2 Y Y Y
CBuilder 3 & 4 Y Y Y N
CBuilder 4 & Newer Y Y Y Y
Visual Basic 63 Y Y Y Y
Visual Studio 2003 Y Y Y Y
Visual Studio 2005 N Y Y Y
Visual Studio 2008 N N N Y4
Visual Objects 2.7 Y Y Y Y
Visual Objects 2.8 N N Y5 Y
Vulcan N N N Y6
Clipper7 Y Y Y Y
Visual FoxPro 9 N N N Y
Crystal Reports 6 - 8 Y Y Y Y
Crystal Reports 9 – 11 N Y Y Y
Crystal Reports 11 R2 & 2008 N N N Y

1 - Advantage 9.0 supports Delphi 6 & 7 but not 3, 4, 5 or 8
2 – Version
3 – Support using ADO(OLEDB or ODBC)
4 – Version or newer
5-  Version or newer
6 – Currently in BETA
7 – The Clipper RDD has not been changed since version 7.0

Alaska software has created their own Advantage Drivers (ADSDBE) which work with all of the versions of Advantage listed above. The XHarbour community has also developed an Advantage driver.

You can also use the Advantage Client Engine (ACE32.dll) directly on both Windows and Linux platforms. The client kit includes header files for Delphi, Visual Basic and C/C++.

You can also find a version matrix on the Advantage Developer zone. This is updated with each Service Release and is the best place for up-to-date information on the current versions of Advantage.

UPDATE: A detailed datasheet describing the supported platforms and development environments has been posted here.

Wednesday, September 17, 2008

Advantage Events Screencast

EventDemo_Title When I posted some example source code for a Visual Studio example which demonstrates using Events(Notifications) with Advantage, I thought it would make a great demo. I showed the application in action last week during the Advantage Technical Summit here in Boise and it was well received. So for everyone who was unable to attend the Technical Summit I put together a short screencast so you can see the application as well.

The screencast demonstrates configuring a new event using Advantage Data Architect (ARC). You can view the screencast, as well as many others, by going to the Advantage Developer Zone and selecting Screencasts from the navigation menu. The screencast is titled “Advantage Events Demo”. You can also go directly to the screencast by clicking here.

You can get additional information about using this great new Advantage 9 feature from the following links:

  • Events(Notifications) overview in the help file
  • Advantage Events overview tech-tip
  • Advantage Events with Visual Studio tech-tip

Monday, September 15, 2008

Book Review: The Pragmatic Programmer

PragmaticProgrammer[2]It has been quite a while since I have been able to sit down and get some reading done. However, I was able to finish "The Pragmatic Programmer" by Andrew Hunt and David Thomas last week. This book is full of great advice, examples and insight which can be used by anyone developing applications at any level. There are 70 practical tips and 11 checklists which give advice on many programming tasks.

The authors waste no time in presenting their tips, in fact, they provide two in the introduction. Tip one is “Care about your craft” which is very closely related to tip seventy “Sign your work”. People who care about their craft tend to build better products and by claiming what you work on you are taking responsibility for the work you are doing. Accountability makes all of us pay more attention to what we are doing and promotes better quality as well.

There is so much good information in this book that it is difficult to highlight the best ones. I found some insight in every chapter and with each tip. This is the kind of book that you could read every year and get something new out of it. I think the best thing to do with this book is to take a handful of tips and work on them and then move to a new group. With this in mind I will highlight the handful of tips that I have chosen.

Tip number four “Don’t live with broken windows” I found particularly interesting. This is based on the Broken Window Theory which basically says that if we do not fix broken windows there is a tendency for more windows to be broken. If we leave bugs in our software after we find them then we place less emphasis on fixing future bugs. Although it is impossible to eliminate all bugs, we are developing software after all, making it a habit to fix bugs when they are discovered encourages us to work harder to ensure our code starts out as bug free as possible.

Although I have been doing quite a bit of self-development this past year I chose tip eight “Invest regularly in your knowledge portfolio” as another to focus on. I have read several programming books this past year and I have done more work in Java. I still have some more to learn with Visual FoxPro the next environment that I am focusing on. The authors recommend getting involved in local user groups, subscribe to trade magazines and to get wired, which back in 1999 meant newsgroups. I think my blog list pretty much covers the get wired requirement but I agree that user groups are a great idea.

Tip number twenty-two is “Use a single editor well”. This emphasizes the need for knowing how to use your tools. We all have our preferences on the best editor to use and the beauty of it is that there are many great editors available. The one you choose is really up to you just focus on knowing all the ins and outs of your editor of choice. You can be much more productive when you know all the tricks of your editor.

Tip number twenty-three is “Always use source code control”, I know your all shocked that I am not doing this. In my defense, as weak as it is, the projects that I typically work on are examples and simple utilities. This isn’t an excuse and I have already begun my search for a source code control system which I will use for all my projects. I am sure this will even spawn a blog post or two.

Tip number twenty-eight is “Learn a text manipulation language”. I have used Python for some simple projects and I have done some limited work with Perl. However, I have not used either for any significant projects in the past. I have used regular expressions successfully and they can be a very powerful tool. So it is time for me to revisit one of these technologies.

Tip number fifty “Don’t use wizard code you do not understand” really struck a chord with me. I have been using Visual Studio for many years along with its ubiquitous wizards. I realized that many times I have used a wizard to complete a task but I have rarely examined the resulting code. The authors make the important point that after the wizard has done its job the code is left to the programmer. If the wizard generated code isn’t working then the wizard isn’t going to fix it. Having an understanding of the wizard code could prove to be an invaluable troubleshooting tool.

Tip number fifty-five “Don’t think outside the box – find the box” was presented in a section entitled Solving Impossible Puzzles. While reading this section I couldn’t help but think about the Kobayashi Maru scenario in which Captain Kirk “changed the conditions of the test”. To solve a really difficult problem you need to examine all of the possibilities closely. By narrowing down the possibilities the solution can be reached.

The bottom line is this book can be a valuable resource and should be a part of your library. There is way too much information to absorb in a single reading, making this a book which could be read many times. Hopefully, I will be able to incorporate the tips I have chosen into my programming practice. Once I have gotten better at these I will move on to some more. In fact, I already have my eyes on the tips related to testing; 48, 49, 62 and 63.

Friday, September 12, 2008

Another Successful Technical Summit

TechSummit Many thanks to everyone who attended the Advantage Technical Summit. We conducted our usual two days of training and added an additional half day of hands-on training. The training was well received and I had a great time interacting with all of the participants during the event.

The half day training went really well and I am continuing to work on revising the content for future training events. I will get the labs posted on the Advantage DevZone in the next few weeks so check back toward the end of September.

If you were unable to attend this Technical Summit we will be having another one next spring. I hope to see you here in Boise.

Wednesday, September 10, 2008

Advantage Introduction Webcast Available

IntroWebcast We had a live webcast on Tuesday September 9th which we broadcast twice with a question and answer session after the presentation. We had good attendance and I would like to thank everyone who attended the live events.

A recording of this introduction to Advantage is available here. The session is about 30 minutes long and covers all of the major features of Advantage. If you have never used Advantage before or are curious about the latest features I encourage you to take a few minutes to watch the presentation.

Monday, September 8, 2008

Lots of Events This Week

Tomorrow we are doing a Webcast on Getting Started With Advantage Database Server you can register for the webcast here. We will be doing a 30 minute overview of Advantage with a question and answer session after the presentation. This is perfect if you are new to Advantage or if you want to learn about the latest features.

We are also doing our Advantage Technical Summit here in Boise starting on Wednesday. I always enjoy these events because it is an opportunity for us to interact with our customers. We enjoy getting all the feedback and hearing about how you are using Advantage out in the field.

This time we are offering an additional half-day of training. It will be a hands-on session where we will work through many of the data dictionary features. There will be several labs which will demonstrate how to create various dictionary objects and give everyone the opportunity to write some SQL scripts. It will also give people some experience using the SQL Debugger which was added in version 9. I’ll let you know how the session goes and hopefully we will continue to offer the hands-on session at future Technical Summits.

Wednesday, September 3, 2008

FAQs – August 2008

Here is the latest installment of my monthly FAQs. August was a very busy month for me and I spent a lot of time working on sample code. Here are a few of the questions I answered last month.

Accessing Free Tables Through a Data Dictionary Connection

In an earlier post about security I discussed disabling free table connections. This ensures that all users authenticate to a data dictionary before they can open any tables. This does not mean that you cannot still access free tables through this connection. In fact you can access any tables in the Dictionaries Default Path. The tables in this path do not need to be associated with the dictionary.

You can also create views which access free tables using a relative path from the dictionary. I demonstrated this technique in a tech-tip where I used a view to allow access to the Advantage Error Log file. This allows your program to access the Advantage Error Log (ads_err.adt) without sharing or making a connection to the Error Log path on the server.

Using Advantage from a Web Site

Advantage has many clients which can be used to access the data from a web site. I primarily use the Advantage .NET Data Provider with ASP.NET for web development. However, we also support DBI, PHP and Java clients. This gives developers a wide variety of connection options when developing their web sites and web based applications.

During our Advantage Technical Training we provide sessions on using Advantage with ASP.NET, PHP and Java. These sessions are very informative and provide lots of information on how to integrate Advantage data into your web site.

Did You Know

You can get the name of the application that is connected to Advantage through the Advantage Management API? When applications connect to Advantage the application name is automatically specified for the ApplictionID property of the connection. This property has now been added to the ADS_MGMT_USER_INFO structure which you can retrieve using the AadsMgGetUserNames API call.

You can also get this information using the sp_mgGetConnectedUsers or sp_GetApplicationID system procedures. The ApplicationID can also be set using the sp_SetApplicationID if you want to specify a specific name or instance of your application for the given connection.

This field was also added to the management utility in version 9.0 of Advantage Data Architect.

Advantage Management Utility

Using Events

Events are a new feature added in version 9.0 of Advantage. Over the past couple of months I have written a couple of tech tips, you can find them here and here, and an example Visual Studio application. Events are a powerful way to notify your application when certain events occur on the database server. I am currently working on an Events sample for Delphi that I will get posted as soon as possible.

In the meantime, if you are using Events or have a good idea for how they can be used please leave me a comment.