You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ibatis.apache.org by "Ron Grabowski (JIRA)" <ib...@incubator.apache.org> on 2005/04/13 02:22:16 UTC

[jira] Commented: (IBATISNET-35) Improve logging of text sent to database and recieved from database to match Java version of IBatis

     [ http://issues.apache.org/jira/browse/IBATISNET-35?page=comments#action_62696 ]
     
Ron Grabowski commented on IBATISNET-35:
----------------------------------------

During a chat with Larry Meadors on the #ibatis chat room I learned that the numbers present in some debug statements:

  {conn-100000} Connection

do not really mean anything (the leading 1000 part at least). They are just a way to group related items. Perhaps we could use GetHashCode() or some sort of CRC32 based on the connection string to uniquely identify connections. In the current version of IBatis there isn't any way to distinguish connections from each other. If a system is making calls to a to an Access database and a SQL Server database, the log files just report that a connection has been opened. Another example of why the connection logged needs to have some identifier with it would be if you did this:

 1 - open connection to access database
 2 - open connection to sql server database
 3 - open connection to sql server database

 2 - closed connection to sql server database
 1 - closed connection to access datbase
 3 - closed connection to sql server database

Currently, the log files would displaying something along the lines of:

 Open Connection
 Open Connectin
 Close Connection
 Close Connection
 Close Connection

Hrmm, that's not the best example...

When asked about how the Java version of IBatis handles large amounts of data such as BLOB columns and NTEXT columns, he said he thought that just a reference id showed up rather than the actual contents of the column. When I asked about weird resultsets like a resultset having multiple resultsets or a resultset having rows and also having output parameters he said that the Java version doesn't currently support that.

> Improve logging of text sent to database and recieved from database to match Java version of IBatis
> ---------------------------------------------------------------------------------------------------
>
>          Key: IBATISNET-35
>          URL: http://issues.apache.org/jira/browse/IBATISNET-35
>      Project: iBatis for .NET
>         Type: Improvement
>     Versions: DataAccess 1.5, DataMapper 1.1
>  Environment: Data Mapper - [assembly: AssemblyVersion("1.1.458")]
> Data Access - [assembly: AssemblyVersion("1.5.458")]
>     Reporter: Ron Grabowski

>
> Here are some example logs from the Java version of IBatis. The examples show INSERT, SELECT, UPDATE, and DELETE statements:
> DEBUG - Checked out connection 30332961 from pool.
> DEBUG - {conn-100003} Connection
> DEBUG - {pstm-100004} PreparedStatement: INSERT INFO UserAudit (UserId, AuditEvent, DateOccurred) values (?,?,?)          
> DEBUG - {pstm-100004} Parameters: [4, audit.login.success, 2004-08-25 09:15:22.809]
> DEBUG - {pstm-100004} Types: [java.lang.Integer, java.lang.String, java.sql.Timestamp]
> DEBUG - {pstm-100005} PreparedStatement: SELECT LAST_INSERT_ID() AS id  
> DEBUG - {pstm-100005} Parameters: []
> DEBUG - {pstm-100005} Types: []
> DEBUG - {rset-100006} ResultSet
> DEBUG - {rset-100006} Header: [id]
> DEBUG - {rset-100006} Result: [422]
> DEBUG - Returned connection 30332961 to pool.
> DEBUG - Checked out connection 30332961 from pool.
> DEBUG - {conn-100007} Connection
> DEBUG - {pstm-100008} PreparedStatement: SELECT UserId, Login, Password FROM User WHERE Login = ? and Password = ?
> DEBUG - {pstm-100008} Parameters: [abc123, def456]
> DEBUG - {pstm-100008} Types: [java.lang.String, java.lang.String]
> DEBUG - {rset-100009} ResultSet
> DEBUG - {rset-100009} Header: [UserId, Login, Password]
> DEBUG - {rset-100009} Result: [4, abc1234, def456]
> DEBUG - Returned connection 30332961 to pool.
> DEBUG - Checked out connection 4548856 from pool.
> DEBUG - {conn-100045} Connection
> DEBUG - {pstm-100046} PreparedStatement: SELECT UserId, Login FROM User
> DEBUG - {pstm-100046} Parameters: []
> DEBUG - {pstm-100046} Types: []
> DEBUG - {rset-100047} ResultSet
> DEBUG - {rset-100047} Header: [UserId, Login]
> DEBUG - {rset-100047} Result: [1, abc123]
> DEBUG - {rset-100047} Result: [4, def456]
> DEBUG - {rset-100047} Result: [6, aaaaa]
> DEBUG - Returned connection 4548856 to pool.
> DEBUG - Checked out connection 7125805 from pool.
> DEBUG - {conn-100043} Connection
> DEBUG - {pstm-100044} PreparedStatement: UPDATE User SET Login = ? WHERE UserId = ?
> DEBUG - {pstm-100044} Parameters: [aaaaa, 4]
> DEBUG - {pstm-100044} Types: [java.lang.String, java.lang.Integer]
> DEBUG - Returned connection 7125805 to pool.
> DEBUG - Checked out connection 27062282 from pool.
> DEBUG - {conn-100043} Connection
> DEBUG - {pstm-100044} PreparedStatement: DELETE FROM User WHERE UserId = ?
> DEBUG - {pstm-100044} Parameters: [4]
> DEBUG - {pstm-100044} Types: [java.lang.Integer]
> DEBUG - Returned connection 27062282 to pool.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


Re: [jira] Commented: (IBATISNET-35) Improve logging of text sent to database and recieved from database to match Java version of IBatis

Posted by Ron Grabowski <ro...@yahoo.com>.
Another typo fix and comment...

 Open Connection
 Open Connection
 Open Connection
 Close Connection
 Close Connection
 Close Connection

Without some sort of identifier on the log messages you don't know
which Close Connections match to which Open Connections. It would be
better if some sort of identifier (a simple incrementing int) was
attached to the message:

 Open Connection 1
 Open Connection 2 
 Open Connection 3
 Close Connection 2
 Close Connection 1
 Close Connection 3

I think IBatisNet should mirror the way Java does it as far as the
wording and layout of the log messages.

--- "Ron Grabowski (JIRA)" <ib...@incubator.apache.org> wrote:

>      [
>
http://issues.apache.org/jira/browse/IBATISNET-35?page=comments#action_62696
> ]
>      
> Ron Grabowski commented on IBATISNET-35:
> ----------------------------------------
> 
> During a chat with Larry Meadors on the #ibatis chat room I learned
> that the numbers present in some debug statements:
> 
>   {conn-100000} Connection
> 
> do not really mean anything (the leading 1000 part at least). They
> are just a way to group related items. Perhaps we could use
> GetHashCode() or some sort of CRC32 based on the connection string to
> uniquely identify connections. In the current version of IBatis there
> isn't any way to distinguish connections from each other. If a system
> is making calls to a to an Access database and a SQL Server database,
> the log files just report that a connection has been opened. Another
> example of why the connection logged needs to have some identifier
> with it would be if you did this:
> 
>  1 - open connection to access database
>  2 - open connection to sql server database
>  3 - open connection to sql server database
> 
>  2 - closed connection to sql server database
>  1 - closed connection to access datbase
>  3 - closed connection to sql server database
> 
> Currently, the log files would displaying something along the lines
> of:
> 
>  Open Connection
>  Open Connectin
>  Close Connection
>  Close Connection
>  Close Connection