Wednesday, September 30, 2009

Delphi 2010 Support

Embarcadero released Delphi 2010 in late August. In keeping with our commitment to supporting the latest version of Delphi we have updated the Advantage Delphi Components to support Delphi 2010.

Both version 8.1 and 9.1 have been updated. You can download the updated components on the Advantage Developer Zone. The latest versions are 8.1.0.46 and 9.1.0.15.

For the latest Advantage updates subscribe to the Advantage Announcements feed.

Monday, September 28, 2009

Getting into Web 2.0

I admit I am a bit behind on this new fangled web 2.0 revolution. However, I have been convinced that there are some good things about many of the social networks that are available. I started with LinkedIn about a year ago adding many of my colleagues and found that it was a good way to stay in contact with people I have worked with in the past.

LinkedIn

If you are on LinkedIn and you have attended one of our Technical Summits in the past join the Advantage Technical Summit Alumni group.

Starting at Southwest Fox last year I was introduced to Twitter. The FoxPro community is very active on Twitter and I started an account as well. I don't do many tweets (twits?) but I send out updates periodically. You can also find JD Mullin, Advantage R&D manager, and Mike Hagman, Advantage product manager on Twitter.

Twitter

I have also created a page on Facebook where I will be posting some events and discussions. I'll do my best to keep this page updated with information about the various events I attend. I have a few ideas on some discussions so feel free to join in.

facebook

If you are a user of StackOverflow and you have questions about Advantage use the "advantage-database-server" tag. You can get more information from our July newsletter.

Remember you can still interact with the Advantage community through our newsgroups.

Wednesday, September 9, 2009

Generating a Server Dump File

Beginning with version 8 of Advantage Database Server the server will generate a dump file when an internal error or exception occurs. This dump file will be written to the error log directory, c:\ by default. The dump file uses the following naming convention

adsdump-CCYYMMDD-HHMMSS.dmp.gz

If your server generates a dump file you can use the ADS Support Capture utility to retrieve the file along with other pertinent information. You should then open a support issue with Advantage support so we can investigate the cause of the error.

ARC_SnapDumpYou can manually create a server dump using Advantage Data Architect. Simply connect to the server using the management utility in ARC and press CTRL-F9. This will cause the server to generate a dump file which can then be sent into Advantage Support. Keep in mind this may have an effect on the performance of any application that is currently connected to the server. When the dump file has been generated a message will be displayed.

For more information about the dump file refer to the help file.

Friday, September 4, 2009

After Action Review

We just finished our latest Advantage Technical Summit. We always have the team sit down together after these events and review how it went. We review the feedback we get from the attendees and review everything that we did looking for; the good, the bad and the ugly. Fortunately there is rarely any ugly.

This has always been a good practice and has provided us with a long running history of our technical summits which gives us something to look at when we begin planning for the next one.

The Army has a similar system called the After Action Review (AAR) which is done after most operations. Whether the operation was big or small soldiers are encouraged to spend a few minutes and evaluate what happened. The AAR consists of a leader asking a three simple questions.

  • What went right?
  • What went wrong?
  • What can we improve for the next time?

Egos are checked at the door and rank does not matter during the AAR. This is to promote honest feedback and constructive criticism about the event. This shouldn't open the door to allow people to insult members of their team, although I have seen this happen. When used correctly the information gathered during the AAR can yield great improvements and serve as a "knowledge base" for new members and leaders in the unit.

So how does this type of thinking fall into the programming world. Just ask Joel Spolsky who used the five whys to help improve the uptime of their servers.

The five whys method involves asking why until the root cause of the problem is discovered. This can be a very useful tool when solving complex programming issues. By asking the right questions your investigations can be focused allowing the root problem to be revealed quicker. This process has been extensively used by Toyota motor company as a methodology to resolve problems. Wikipedia has a simple example of the process

My car will not start. (the problem)

  1. Why? - The battery is dead. (first why)
  2. Why? - The alternator is not functioning. (second why)
  3. Why? - The alternator belt has broken. (third why)
  4. Why? - The alternator belt was well beyond its useful service life and has never been replaced. (fourth why)
  5. Why? - I have not been maintaining my car according to the recommended service schedule. (fifth why, a root cause)

Regardless of what method you prefer taking some time to look back after a particular milestone will pay great dividends in the future. Having an historical reference to review before beginning a process could provide the valuable insight you need to make it the most successful process ever.

Wednesday, September 2, 2009

FAQs – August 2009

Signaling an Event

It has been about a year since I wrote a demo and an article on using Advantage Notifications. You can read the technical overview in this tech tip. There is a Visual Studio example application available on Code Central.

One potential pitfall when using events is how the data path is defined. Events are registered with the connection path and name therefore all clients that wish to listen for a particular event need to be using the same connection path. For best results I recommend using a UNC path with the IP address, Port number and share/alias name (i.e. \\192.168.0.10:6262\MyData ). Using the same connection path and event name from all clients will ensure that all clients are notified when the event is triggered.

Using the Advantage Delphi Components on Vista

By default the Advantage Delphi Components are installed to the Program Files directory (C:\Program Files\Advantage 9.10\TDataSet). Normal users do not have rights to create new files in the Program Files directory. Therefore when you compile your application you may receive a F2039 compiler error in Delphi.

This error can be avoided by turning off the Vista User Access Control (UAC), which is not recommended. You can run Delphi as an Administrator which has the proper rights to create files under the Program Files directory or you can change the output path for your project.

You can get detailed instructions about these options from this knowledge base item. Windows 7 has the same security restrictions as Vista.

Passing Data with Temp Tables

Temporary tables can be created with SQL statements by preceding the table name with a pound ( # ) symbol. These tables are only available on the connection and are destroyed when the connection is closed. These tables can be very useful for passing information to stored procedures and views.

Stored procedures accept input parameters through the __input table. However, this table can only contain a single row so you must call the stored procedure over and over if you need to run it multiple times with different parameters. By using a temporary table you can populate the temporary table with multiple records. The stored procedure could then loop through the table processing multiple inputs with a single call.

This technique can also be used to pass a parameter to a view. This tech-tip demonstrates the technique.

Using LINQ to SQL with Prism

Delphi Prism allows object Pascal code, called oxygene, to be compiled by Visual Studio. It comes with the Visual Studio 2008 shell and can be used as a stand alone product. It contains many of the features of Visual Studio including the use of Language Integrated Query (LINQ).

Cary Jensen wrote two blog posts about using LINQ to SQL on his blog. Part I introduces you to the LINQ syntax and part II demonstrates using LINQ to SQL in Prism.