FAQ's
This section covers some of the common questions that can occur when getting into Vanatec OpenAccess and object-relational mapping, and it provides all the questions and troubleshooting steps you need to resolve an issue.
How to integrate OpenAccess 4.3.4 into Orcas Beta 1?
We are planning an installer based integration for the next patch. In the meantime here is a way to get the integration with some small steps:
- Install Orcas Beta 1
- Install Visual J# 2.0 Runtime System (external link)
- Install Vanatec OpenAccess
- Generate addin file for Visual Studio 9.0 as follows:
- Go to "C:\Program Files\Vanatec OpenAccess\sdk\dotnet20\IDEIntegrations\Microsoft Visual Studio 2005\addin" or your installation directory. - Make a copy of the file OpenAccessAddin80.AddIn to OpenAccessAddin90.AddIn - Open the file in an editor (vs90 or notepad) and change the version from 8.0 to 9.0
- Load addin in Orcas beta 1
- Start Orcas - Open: Tools->Option --> Environment->Add-in/Macros Security - Click Add and browse to: "C:\Program Files\Vanatec OpenAccess\sdk\dotnet20\IDEIntegrations\Microsoft Visual Studio 2005\addin" - Press OK - Close options dialog by pressing ok
- Restart Visual Studio Orcas Beta 1
Which new features are provided with Vanatec OpenAccess in 4.0 for .NET 2.0 & Visual Studio 2005?
Vanatec OpenAccess 4.0 supports Generics and Nullable Data Types, Struct Support and native Authentication have also been added. More new features will be implemented over the next weeks:
- ADO .NET 2.0 Support - Code Snipplets - Mapping Wizard Improvements - Improved Exception Handling - Horizontal Mapping - Direct Connection Support - Query Tester
Which databases are supported?
Microsoft SQL Server 2000 and 2005, Oracle 9 and 10, MySQL 5, Advantage Database Server 8.1, Sybase SQL Anywhere 10, Firebird 2.
How do I install the Microsoft SQL Server 2000 Desktop Edition (MSDE) for use with Vanatec OpenAccess?
You can develop your application with Vanatec OpenAccess using the Microsoft SQL Server 2000 Desktop Edition as the database. It’s easy to use and best of all it’s free. The following steps describe how to install the MSDE for use with Vanatec OpenAccess.
1. You can download the MSDE from the Microsoft website (www.microsoft.com/sql/msde/downloads/). Follow the instructions to download the MSDE in the language of your choice. The downloaded file will have the name MSDE2000A.exe (for English) or LAN_MSDE2000A.exe where LAN indicates the language you chose.
2. The file you download is a self-extracting installation package. Double-click the file to extract the installation files. Accept the license agreement and select a directory where you want the installation files extracted.
3. The directory you chose in Step 2 will contain the MSDE setup.exe program. You will have to provide some parameters to the setup program. You can run setup.exe from a command line shell or from the Windows Start menu Run… dialog. The following shows the setup command with the appropriate parameters to install the MSDE for Vanatec OpenAccess.
C:\MSDERelA\setup SAPWD=”password” TARGETDIR=”C:\MSDE” SECURITYMODE=SQL DISABLENETWORKPROTOCOLS=0
The above command should be typed all on one line. The directory shown is the default. Use the one you chose in Step 2. The password parameter is an administrator password for the machine and is required. The TARGETDIR can be a directory of your choice. The SECURITYMODE=SQL parameter allows any user with “SQL” authorization to access the MSDE. This is not generally recommended by Microsoft but is required by Vanatec OpenAccess. The DISABLENETWORKPROTOCOLS=0 parameter allows connection via TCP/IP and is also required for Vanatec OpenAccess.
4. After installing the MSDE, you can delete the directory containing the installation files.
5. Add a user login: osql -E -S localhost -Q"sp_addlogin vanatec,'vanatec','master'" osql -E -S localhost -Q"sp_addsrvrolemember 'vanatec', 'dbcreator'"
How do I install the Microsoft SQL Server Web Data Administrator tool?
The MSDE does not include an administration tool. However, you can use the Microsoft SQL Server Web Data Administrator provided that you are running IIS Webserver or the Microsoft .NET Shared Source web server. To install the SQL Server Web Data Administrator with the IIS Webserver, 1. Download the SQL Server Web Data Administrator from the Microsoft website. Go to http:/www.microsoft.com/downloads/ and search for “SQL Server Web Data Administrator”. 2. Run the downloaded file, setup.msi, to install the Web Data Administrator. 3. Create a new virtual directory under IIS. In the Control Panel, open Administrative Tools and select Internet Information Services. Create the new virtual directory in the Default Web Site. (Name it “webadmin” for example.) Point the virtual directory to the “C:\Program Files\Microsoft SQL Server Tools\Microsoft SQL Web Data Administrator\Samples\SqlWebAdmin” directory. 4. Edit the SqlWebAdmin.csproj.webinfo file so that the URLPath points to the SqlWebAdmin.csproj file in the virtual directory you created in Step 3. For example, if you named the virtual directory “webadmin”, as above, the entry in SqlWebAdmin.csproj.webinfo is:
<VisualStudioUNCWeb> <Web URLPath = "http://localhost/webadmin/SqlWebAdmin.csproj" /> </VisualStudioUNCWeb>
Note: If you have installed IIS after .NET Framework, you will have to manually install .NET ASP services in IIS. To do this from a command line, go to your .NET Framework installation directory (e.g., “C:\WINNT\Microsoft.NET\Framework\v1.1.4322”) and execute the aspnet_regiis.exe program with the -i switch: >asnet_regiis -i Also make sure that any proxies are bypassed for localhost.
How does Vanatec OpenAccess handle server authorization?
There are different drivers for different database available. For MS SQL 2000, MSDE and Oracle only SQL authentication is supported. The user name and password are supplied in the configuration file. The user name and password can also be supplied in the Database.GetObjectScope() method call. For MS SQL 2005 and MS Express you can use integrated security.
How does Vanatec OpenAccess handle database creation?
If the user specified in the configuration file has creation rights, the database will be created, if needed, as part of the build process in Visual Studio. The database can be also created using the appropriate database tools. In this case the user specified in the configuration file does not creation rights.
So, how good is the performance of Vanatec OpenAccess?
At this time, we don’t have any real-world measure of performance for O/R mapping tools. Applications are beginning to be developed in Java using Versant Open Access JDO, where Vanatec OpenAccess comes from. The Vanatec OpenAccess product is based on the same Object/Relational Mapper technology behind Versant Open Access JDO and so you should expect similar performance. Our experience has shown that Open Access JDO provides measurable performance gains over in-house O/R mapping solutions. As an example, an evaluation by Volkswagen AG comparing Open Access JDO to their in-house developed Java / SQL Mapping Tool showed a factor of two performance increase using OpenAccess. That is, all database operations were performed at least twice as fast using OpenAccess. This corroborates our experience that even well maintained internal mapping solutions may not provide the best performance. Please take a look also at http://www.middlewareresearch.com/torpedo/results.jsp where you can see how our engine compares to other O/R Mapping vendors (only Java). Here you can find a description of the benchmark http://www.middlewareresearch.com/torpedo/faq.jsp. An important point regarding performance measures is that no generic performance test can reflect how a given solution compares to another in the “real-world”. In high-demand applications, the only sensible approach is to compare the performance of different solutions in the context of the application design and the data model that is actually used. Also, performance depends on various factors of the application design. These factors include how the application uses navigational access, queries, and class inheritance or the definition of the database tables. Additionally, the use of caching and object pooling, for example, can have a significant affect on the overall performance compared to native SQL code. Our consulting team can help you develop a test model to evaluate available solutions in a real-world context.
Where do I set event logging to 'all', so that I can see all the parameters?
This can be set in the backend configuration in the app config file: <backendconfiguration id="mssqlConfiguration" backend="mssql"> <logging.logEvents>all</logging.logEvents> <logging.logEventsToSysOut>true</logging.logEventsToSysOut> </backendconfiguration> The same can be made from in the Backend Configuration in the Logging section of the OpenAccess Menu.
Does the SaveAll () method distinguish which objects have been changed and which ones do not need to be updated?
Yes, only changed objects will be updated.
Can I use legacy stored procedures with complex filter criteria’s (for speed reasons)?
Yes
Is the product limited to Microsoft SQL Server only?
Today you can use MS SQL 2000 and 2005, MS SQL Express, MSDE Servers 2000, Oracle and MySQL.
What is the cost / license structure?
The product is licensed per named developer, there are no runtime fees. For more details check www.vanatec.com/en/product-information/pricing-availability There is also a free version with all functionallity which works with free databases like SQL Express, MySQL and the Oracle Express Version.
The installation asks for JSR1.1-KB891863-X86.exe, where do I find it?
It is only used when you are working with VS2003
Can I use a non default port for the database server?
Normally the MSDE and/or the MS SQL use the port number 1433. For security reasons it might be useful to use another port number, e.g. 1444. If you want to reach this server you must provide the port number in the Vanatec OpenAccess "Enable Project" Wizard with Server Name -> localhost:1444 ( server name : port number )
What to do if your application does not find a Persistent Class definition
The enhanced classes have a static constructor that registers all the necessary information in one global structure. This structure must be filled when the first Database.Get call is used because OpenAccess builds up meta information at this point in time. Microsoft’s assembly load strategy loads an assembly at that time and the first type out of the assembly is used. Because of this OpenAccess applications must instantiate one object from each assembly with persistent classes before the first Database.Get call, to be sure all necessary OpenAccess information is computed.
To test if everything is correct, you can execute the code below directly before your first Database.Get call. The code prints out all the loaded assemblies, the enhanced status and all the loaded persistent classes. If you can see that your assemblies are enhanced and all your persistent types are printed out this part is correct. If not, please create an instance of the missing Persistent Class above the code.
Visual Basic Code:
'list all loaded assemblies, list enhanced status
'and all enhanced persistent classes
Dim assemblies() As System.Reflection.Assembly
assemblies = AppDomain.CurrentDomain.GetAssemblies
For Each assembly As Reflection.Assembly In assemblies
Dim name As String
name = assembly.FullName
name = name.Substring(0, name.IndexOf(","))
System.Console.WriteLine(name)
'test if assembly is enhanced
Dim moduleInfo As Type
moduleInfo = assembly.GetType("OpenAccessEnhancedModuleInfo", False, False)
If Not moduleInfo Is Nothing Then
System.Console.WriteLine(" Enhanced!")
'print all persistent classes in assembly
For Each t As Type In assembly.GetTypes()
If GetType(OpenAccess.SPI.dataobjects.PersistenceCapable) _
.IsAssignableFrom(t) Then
System.Console.WriteLine(" Persistent Type: " _
+ t.FullName)
End If
Next
End If
Next
C# Code:
// list all loaded assemblies, list enhanced status
// and all enhanced persistent classes
System.Text.StringBuilder strbuf = new System.Text.StringBuilder();
System.Reflection.Assembly[] assemblies =
System.AppDomain.CurrentDomain.GetAssemblies();
foreach (System.Reflection.Assembly assembly in assemblies)
{
string name = assembly.FullName;
name = name.Substring(0, name.IndexOf(','));
strbuf.Append(name).Append("\r\n");
// test if assembly is enhanced
Type moduleInfo = assembly
.GetType("OpenAccessEnhancedModuleInfo", false, false);
if (moduleInfo != null)
{
strbuf.Append(" Enhanced!\r\n");
// print all persistent object in assembly
foreach (Type t in assembly.GetTypes())
if (typeof(OpenAccess.SPI.dataobjects.PersistenceCapable)
.IsAssignableFrom(t))
strbuf.Append(" Persistent Type: ")
.Append(t.FullName).Append("\r\n");
}
}
// print info -> console or trace or what ever
System.Console.WriteLine(strbuf.ToString());
|