MediaPortal Forums HTPC/MediaCenter

Go Back   MediaPortal Forum » MediaPortal TV-Server » Help on Development » Development


Development You want to code something for the TV-Server? Share it in here!

Reply
 
Thread Tools Display Modes
Old 2007-01-30, 21:48   #41 (permalink)
Portal Member
 
Join Date: Nov 2006
Posts: 60
Thanks: 0
Thanked 1 Time in 1 Post

Country:

My System

Send a message via Skype™ to blaudden
Default

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 is offline   Reply With Quote
Old 2007-01-30, 21:50   #42 (permalink)
Portal Member
 
Join Date: Nov 2006
Posts: 60
Thanks: 0
Thanked 1 Time in 1 Post

Country:

My System

Send a message via Skype™ to blaudden
Default

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 is offline   Reply With Quote
Old 2007-01-30, 22:32   #43 (permalink)
Portal Member
 
Join Date: Nov 2006
Posts: 60
Thanks: 0
Thanked 1 Time in 1 Post

Country:

My System

Send a message via Skype™ to blaudden
Default

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;
}
blaudden is offline   Reply With Quote
Old 2007-02-01, 11:58   #44 (permalink)
Portal Member
 
THDBASED's Avatar
 
Join Date: Jan 2006
Posts: 468
Thanks: 72
Thanked 2 Times in 2 Posts

Country:

My System

Default

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
THDBASED is offline   Reply With Quote
Old 2007-02-01, 14:28   #45 (permalink)
Portal Member
 
Join Date: Nov 2006
Posts: 60
Thanks: 0
Thanked 1 Time in 1 Post

Country:

My System

Send a message via Skype™ to blaudden
Default

Tried to setup the Gentle.Net framework to create a logfile of what it was doing. Couldn't figure it out.

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.
blaudden is offline   Reply With Quote
Reply

Bookmarks

Tags
mysql, option

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Codec isntall option in SVN Glith Improvement Suggestions 2 2006-10-24 23:12
REQ: Auto-View option for music (other) folders ala XBMC HappyTalk Improvement Suggestions 1 2006-08-29 18:43
MyPrograms view option (really small request) Waltz Improvement Suggestions 0 2006-08-09 01:03
Internal SVN update option? nst6563 Improvement Suggestions 13 2006-05-29 10:38
WDM Drivers Internal Sound Source Option! dbx Improvement Suggestions 1 2005-07-06 19:37


All times are GMT +1. The time now is 11:43.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 Protected by Akismet Blog with WordPress
Advertisement System V2.6 By   Branden