MySQL option (1 Viewer)

blaudden

Portal Pro
November 19, 2006
68
2
Home Country
Sweden Sweden
About the "auto increment" values not starting at zero. It is caused by an initial auto increment value specified in the CREATE found in mysqldatabase.sql

I do not know if it really matters to how the application works, but to fix, just remove the "AUTO_INCREMENT=5" part from the CREATE
 

blaudden

Portal Pro
November 19, 2006
68
2
Home Country
Sweden Sweden
Ex:
CREATE-TABLE `card` (
`idCard` int(11) NOT NULL auto_increment,
#^^^^^^ This is an autoincrement column
`devicePath` varchar(2000) NOT NULL,
<snip>
) ENGINE=MyISAM AUTO_INCREMENT=5;
#^^^^^^ This specifies the inital value for the autoinc column

Intentionally spelling wrong since some SQL commands are not allowed in posts. ;)
 

blaudden

Portal Pro
November 19, 2006
68
2
Home Country
Sweden Sweden
Will just reply one more thing to myself tonight.

Looked in the Gentle.NET Framework and in PersistenceBroker I find the below code indicating unless either "con" or "tr" is passed to Retrieve it will create a new connection to the database engine for each retrieve. If that could be avoided I'm sure the perfomance would be improved - maybe for all database engines. But it could be that MSSQL is using client side connection pooling and has no need to run those initial queries?

Just need to find the place in TvServer code where this is called. Or is this something explicitly handled by the FrameWork?

/// <summary>
/// Retrieve data for the specified type. Throws an exception for unsupported types.
/// </summary>
/// <param name="type">The type of object</param>
/// <param name="key">The key indentifying the object</param>
/// <param name="conn">An existing database connection to reuse. This is useful
/// when you need to execute statements in the same session as a previous statement.</param>
/// <param name="tr">The database transaction for when participating in transactions.</param>
/// <returns>An SqlResult containing the returned rows and helper methods</returns>
public SqlResult Retrieve( Type type, Key key, IDbConnection conn, IDbTransaction tr )
{
SqlStatement stmt = GetRetrieveStatement( type, key );
// connections are supplied from outside when in a transaction or executing batch queries
conn = tr != null ? tr.Connection : ( conn != null ? conn : stmt.SessionBroker.Provider.GetConnection() );
SqlResult sr = stmt.Execute( conn, tr );
// require that operation succeeded and a valid result
if( IsPrimaryKeyForType( type, key ) )
{
Check.Verify( sr.ErrorCode == 0, Error.NoSuchRecord, type, key, sr.Error );
Check.Verify( sr.RowsContained == 1, Error.UnexpectedRowCount, sr.RowsContained, 1 );
}
return sr;
}
 

THDBASED

Portal Pro
January 30, 2006
469
2
Home Country
Belgium Belgium
Hey,

I have been away for a few days, but it is great to see that somebody is working on the performance with Mysql...This weekend I will do some digging myself and try to test the performance and maybe come up with some adjustments myself!

Thanks for the hard work and please continue your work!

Greetz,

THDBASED
 

blaudden

Portal Pro
November 19, 2006
68
2
Home Country
Sweden Sweden
Tried to setup the Gentle.Net framework to create a logfile of what it was doing. Couldn't figure it out. :confused:

I think it uses "log4net" and it should be possible to add some lines to either Gentle.config or some other config file. The settings I added was read, I could see the TvService shutdown and write an error.log. Hehe. Changed them a little to avoid the "crash" and no log file was produced.


Also tried to build the TvServer with debug(that would be nice) but there was some build failure with missing "Merge modules\Microsoft_vc80_crt_x86.msm", but maybe this was only for Setup.vdproj so the binary for TvServer was probably already built. Any hints for building TvServer could not be found.
 

Users who are viewing this thread

Top Bottom