Problem with PROPERTY_IDENTITY_COLUMN_FILTER

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Problem with PROPERTY_IDENTITY_COLUMN_FILTER

nodje
Hi,

I'm trying to reenable some old code that use to work.

connection.getConfig().setProperty(InsertIdentityOperation.PROPERTY_IDENTITY_COLUMN_FILTER,
IDENTITY_FILTER_EXTENDED);

causes -->Did not find property with name
'http://www.dbunit.org/properties/mssql/identityColumnFilter'

in DatabaseConfig:setProperty:216 -> convertIfNeeded:242 ->
findByName:411, InsertIdentityOperation.PROPERTY_IDENTITY_COLUMN_FILTER
is not found in the ALL_PROPERTIES list.

I'm using version 2.4.8.

I don't understand why this documented property is not found.
Is there a new way to use it?

Cheers


------------------------------------------------------------------------------
Index, Search & Analyze Logs and other IT data in Real-Time with Splunk
Collect, index and harness all the fast moving IT data generated by your
applications, servers and devices whether physical, virtual or in the cloud.
Deliver compliance at lower cost and gain new business insights.
Free Software Download: http://p.sf.net/sfu/splunk-dev2dev
_______________________________________________
dbunit-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dbunit-user
Reply | Threaded
Open this post in threaded view
|

Re: Problem with PROPERTY_IDENTITY_COLUMN_FILTER

nodje
If it's a bug, it should be reported somewhere.
Where is the bug tracking system?

André Abe Vicente wrote:

> Nodge I think I had this problem.
> I correct the bug by myself implementing my own
> InsertIdentityOperation.java (attached)
>
>  
> JdbcDatabaseTester databaseTester = new
> JdbcDatabaseTester("com.microsoft.sqlserver.jdbc.SQLServerDriver",
>          
>  "jdbc:sqlserver://serverName;DatabaseName=databaseName;SelectMethod=cursor",
> "login", "password");  
>
>  databaseTester.setSetUpOperation(InsertOperationMSSQL.INSERT);
>
>
> On Tue, Feb 22, 2011 at 8:22 AM, nodje <nodje.co
> <http://nodje.co>@gmail.com <http://gmail.com>> wrote:
>
>     Hi,
>
>     I'm trying to reenable some old code that use to work.
>
>     connection.getConfig().setProperty(InsertIdentityOperation.PROPERTY_IDENTITY_COLUMN_FILTER,
>     IDENTITY_FILTER_EXTENDED);
>
>     causes -->Did not find property with name
>     'http://www.dbunit.org/properties/mssql/identityColumnFilter'
>
>     in DatabaseConfig:setProperty:216 -> convertIfNeeded:242 ->
>     findByName:411, InsertIdentityOperation.PROPERTY_IDENTITY_COLUMN_FILTER
>     is not found in the ALL_PROPERTIES list.
>
>     I'm using version 2.4.8.
>
>     I don't understand why this documented property is not found.
>     Is there a new way to use it?
>
>     Cheers
>
>
>     ------------------------------------------------------------------------------
>     Index, Search & Analyze Logs and other IT data in Real-Time with Splunk
>     Collect, index and harness all the fast moving IT data generated by your
>     applications, servers and devices whether physical, virtual or in
>     the cloud.
>     Deliver compliance at lower cost and gain new business insights.
>     Free Software Download: http://p.sf.net/sfu/splunk-dev2dev
>     _______________________________________________
>     dbunit-user mailing list
>     [hidden email]
>     <mailto:[hidden email]>
>     https://lists.sourceforge.net/lists/listinfo/dbunit-user
>
>

------------------------------------------------------------------------------
Free Software Download: Index, Search & Analyze Logs and other IT data in
Real-Time with Splunk. Collect, index and harness all the fast moving IT data
generated by your applications, servers and devices whether physical, virtual
or in the cloud. Deliver compliance at lower cost and gain new business
insights. http://p.sf.net/sfu/splunk-dev2dev 
_______________________________________________
dbunit-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dbunit-user
Reply | Threaded
Open this post in threaded view
|

Re: Problem with PROPERTY_IDENTITY_COLUMN_FILTER

nodje
In reply to this post by nodje
André,
there's something I don't get with your implementation.

I still have to affect the property:

connection.getConfig().setProperty(InsertOperationMSSQL.PROPERTY_IDENTITY_COLUMN_FILTER,
IDENTITY_FILTER_EXTENDED);

so that the IDENTITY_FILTER_EXTENDED is taken into account.

It doesn't solve the bug, or there's probably an other way to use it.

Please let me know.


André Abe Vicente wrote:

> Nodge I think I had this problem.
> I correct the bug by myself implementing my own
> InsertIdentityOperation.java (attached)
>
>  
> JdbcDatabaseTester databaseTester = new
> JdbcDatabaseTester("com.microsoft.sqlserver.jdbc.SQLServerDriver",
>          
>  "jdbc:sqlserver://serverName;DatabaseName=databaseName;SelectMethod=cursor",
> "login", "password");  
>
>  databaseTester.setSetUpOperation(InsertOperationMSSQL.INSERT);
>
>
> On Tue, Feb 22, 2011 at 8:22 AM, nodje <nodje.co
> <http://nodje.co>@gmail.com <http://gmail.com>> wrote:
>
>     Hi,
>
>     I'm trying to reenable some old code that use to work.
>
>     connection.getConfig().setProperty(InsertIdentityOperation.PROPERTY_IDENTITY_COLUMN_FILTER,
>     IDENTITY_FILTER_EXTENDED);
>
>     causes -->Did not find property with name
>     'http://www.dbunit.org/properties/mssql/identityColumnFilter'
>
>     in DatabaseConfig:setProperty:216 -> convertIfNeeded:242 ->
>     findByName:411, InsertIdentityOperation.PROPERTY_IDENTITY_COLUMN_FILTER
>     is not found in the ALL_PROPERTIES list.
>
>     I'm using version 2.4.8.
>
>     I don't understand why this documented property is not found.
>     Is there a new way to use it?
>
>     Cheers
>
>
>     ------------------------------------------------------------------------------
>     Index, Search & Analyze Logs and other IT data in Real-Time with Splunk
>     Collect, index and harness all the fast moving IT data generated by your
>     applications, servers and devices whether physical, virtual or in
>     the cloud.
>     Deliver compliance at lower cost and gain new business insights.
>     Free Software Download: http://p.sf.net/sfu/splunk-dev2dev
>     _______________________________________________
>     dbunit-user mailing list
>     [hidden email]
>     <mailto:[hidden email]>
>     https://lists.sourceforge.net/lists/listinfo/dbunit-user
>
>

------------------------------------------------------------------------------
Free Software Download: Index, Search & Analyze Logs and other IT data in
Real-Time with Splunk. Collect, index and harness all the fast moving IT data
generated by your applications, servers and devices whether physical, virtual
or in the cloud. Deliver compliance at lower cost and gain new business
insights. http://p.sf.net/sfu/splunk-dev2dev 
_______________________________________________
dbunit-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dbunit-user
Reply | Threaded
Open this post in threaded view
|

Re: Problem with PROPERTY_IDENTITY_COLUMN_FILTER

André VICENTE
There´s a help on DBUnit oficial site, but I didn´t know how to use this IdentityColumnFilter.
If you discover how to use that, let us know :)

===========================

How to use InsertIdentityOperation with user defined types?

The IColumnFilter interface is now used by InsertIdentityOperation to detect identity columns. The default implementation assumes that type name of identity columns end with "identity". If you are using user defined types that does not follow this assumption you can now provide your own implementation via the MS SQL identity column filter property.

IDatabaseConnection connection = new DatabaseConnection(jdbcConnection);
connection.getConfig().setProperty(
    "http://www.dbunit.org/properties/mssql/identityColumnFilter",
    new MyIndentityFilter());

MS SQL Server IDENTITY column filter

Default none
Description Use to override IDENTITY column detection. The Object must implement org.dbunit.dataset.filter.IColumnFilter .


On Wed, Feb 23, 2011 at 3:29 AM, nodje <nodje.co@gmail.com> wrote:
André,
there's something I don't get with your implementation.

I still have to affect the property:

connection.getConfig().setProperty(InsertOperationMSSQL.PROPERTY_IDENTITY_COLUMN_FILTER,
IDENTITY_FILTER_EXTENDED);

so that the IDENTITY_FILTER_EXTENDED is taken into account.

It doesn't solve the bug, or there's probably an other way to use it.

Please let me know.


André Abe Vicente wrote:
> Nodge I think I had this problem.
> I correct the bug by myself implementing my own
> InsertIdentityOperation.java (attached)
>
>
> JdbcDatabaseTester databaseTester = new
> JdbcDatabaseTester("com.microsoft.sqlserver.jdbc.SQLServerDriver",
>
>  "jdbc:sqlserver://serverName;DatabaseName=databaseName;SelectMethod=cursor",
> "login", "password");
>
>  databaseTester.setSetUpOperation(InsertOperationMSSQL.INSERT);
>
>
> On Tue, Feb 22, 2011 at 8:22 AM, nodje <nodje.co
> <http://nodje.co>@gmail.com <http://gmail.com>> wrote:
>
>     Hi,
>
>     I'm trying to reenable some old code that use to work.
>
>     connection.getConfig().setProperty(InsertIdentityOperation.PROPERTY_IDENTITY_COLUMN_FILTER,
>     IDENTITY_FILTER_EXTENDED);
>
>     causes -->Did not find property with name
>     'http://www.dbunit.org/properties/mssql/identityColumnFilter'
>
>     in DatabaseConfig:setProperty:216 -> convertIfNeeded:242 ->
>     findByName:411, InsertIdentityOperation.PROPERTY_IDENTITY_COLUMN_FILTER
>     is not found in the ALL_PROPERTIES list.
>
>     I'm using version 2.4.8.
>
>     I don't understand why this documented property is not found.
>     Is there a new way to use it?
>
>     Cheers
>
>
>     ------------------------------------------------------------------------------
>     Index, Search & Analyze Logs and other IT data in Real-Time with Splunk
>     Collect, index and harness all the fast moving IT data generated by your
>     applications, servers and devices whether physical, virtual or in
>     the cloud.
>     Deliver compliance at lower cost and gain new business insights.
>     Free Software Download: http://p.sf.net/sfu/splunk-dev2dev
>     _______________________________________________
>     dbunit-user mailing list
>     [hidden email]
>     <mailto:[hidden email]>


------------------------------------------------------------------------------
Free Software Download: Index, Search & Analyze Logs and other IT data in
Real-Time with Splunk. Collect, index and harness all the fast moving IT data
generated by your applications, servers and devices whether physical, virtual
or in the cloud. Deliver compliance at lower cost and gain new business
insights. http://p.sf.net/sfu/splunk-dev2dev 
_______________________________________________
dbunit-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dbunit-user
Reply | Threaded
Open this post in threaded view
|

Re: Problem with PROPERTY_IDENTITY_COLUMN_FILTER

Roberto Lo Giacco
In reply to this post by nodje
The dbUnit issue trackers are hosted on sourceforge:
 http://sourceforge.net/projects/dbunit

On Wed, Feb 23, 2011 at 06:29, nodje <[hidden email]> wrote:

> André,
> there's something I don't get with your implementation.
>
> I still have to affect the property:
>
> connection.getConfig().setProperty(InsertOperationMSSQL.PROPERTY_IDENTITY_COLUMN_FILTER,
> IDENTITY_FILTER_EXTENDED);
>
> so that the IDENTITY_FILTER_EXTENDED is taken into account.
>
> It doesn't solve the bug, or there's probably an other way to use it.
>
> Please let me know.
>
>
> André Abe Vicente wrote:
>> Nodge I think I had this problem.
>> I correct the bug by myself implementing my own
>> InsertIdentityOperation.java (attached)
>>
>>
>> JdbcDatabaseTester databaseTester = new
>> JdbcDatabaseTester("com.microsoft.sqlserver.jdbc.SQLServerDriver",
>>
>>  "jdbc:sqlserver://serverName;DatabaseName=databaseName;SelectMethod=cursor",
>> "login", "password");
>>
>>  databaseTester.setSetUpOperation(InsertOperationMSSQL.INSERT);
>>
>>
>> On Tue, Feb 22, 2011 at 8:22 AM, nodje <nodje.co
>> <http://nodje.co>@gmail.com <http://gmail.com>> wrote:
>>
>>     Hi,
>>
>>     I'm trying to reenable some old code that use to work.
>>
>>     connection.getConfig().setProperty(InsertIdentityOperation.PROPERTY_IDENTITY_COLUMN_FILTER,
>>     IDENTITY_FILTER_EXTENDED);
>>
>>     causes -->Did not find property with name
>>     'http://www.dbunit.org/properties/mssql/identityColumnFilter'
>>
>>     in DatabaseConfig:setProperty:216 -> convertIfNeeded:242 ->
>>     findByName:411, InsertIdentityOperation.PROPERTY_IDENTITY_COLUMN_FILTER
>>     is not found in the ALL_PROPERTIES list.
>>
>>     I'm using version 2.4.8.
>>
>>     I don't understand why this documented property is not found.
>>     Is there a new way to use it?
>>
>>     Cheers
>>
>>
>>     ------------------------------------------------------------------------------
>>     Index, Search & Analyze Logs and other IT data in Real-Time with Splunk
>>     Collect, index and harness all the fast moving IT data generated by your
>>     applications, servers and devices whether physical, virtual or in
>>     the cloud.
>>     Deliver compliance at lower cost and gain new business insights.
>>     Free Software Download: http://p.sf.net/sfu/splunk-dev2dev
>>     _______________________________________________
>>     dbunit-user mailing list
>>     [hidden email]
>>     <mailto:[hidden email]>
>>     https://lists.sourceforge.net/lists/listinfo/dbunit-user
>>
>>
>
> ------------------------------------------------------------------------------
> Free Software Download: Index, Search & Analyze Logs and other IT data in
> Real-Time with Splunk. Collect, index and harness all the fast moving IT data
> generated by your applications, servers and devices whether physical, virtual
> or in the cloud. Deliver compliance at lower cost and gain new business
> insights. http://p.sf.net/sfu/splunk-dev2dev
> _______________________________________________
> dbunit-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/dbunit-user
>

------------------------------------------------------------------------------
Free Software Download: Index, Search & Analyze Logs and other IT data in
Real-Time with Splunk. Collect, index and harness all the fast moving IT data
generated by your applications, servers and devices whether physical, virtual
or in the cloud. Deliver compliance at lower cost and gain new business
insights. http://p.sf.net/sfu/splunk-dev2dev 
_______________________________________________
dbunit-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dbunit-user
Reply | Threaded
Open this post in threaded view
|

Re: Problem with PROPERTY_IDENTITY_COLUMN_FILTER

nodje
In reply to this post by André VICENTE
Well, that's exactly what I was using:

final IColumnFilter IDENTITY_FILTER_EXTENDED = new IColumnFilter() {
            public boolean accept(String tableName, Column column) {
                return column.getSqlTypeName().contains("SEQUENCE") &&
!column.getColumnName().contains("_ID_FK");
            }
        };

connection.getConfig().setProperty(InsertOperationMSSQL.PROPERTY_IDENTITY_COLUMN_FILTER,
IDENTITY_FILTER_EXTENDED);

And it used to work totally fine, until I recently tried to reintegrate
this code using a newer dbunit version, namely 2.4.7 & 2.4.8, and got
this exception:

Did not find property with name
>     >     'http://www.dbunit.org/properties/mssql/identityColumnFilter'



André Abe Vicente wrote:

> There´s a help on DBUnit oficial site, but I didn´t know how to use this
> IdentityColumnFilter.
> If you discover how to use that, let us know :)
>
> ===========================
>
> How to use InsertIdentityOperation with user defined types?
>
>     The IColumnFilter interface is now used by InsertIdentityOperation
>     to detect identity columns. The default implementation assumes that
>     type name of identity columns end with "identity". If you are using
>     user defined types that does not follow this assumption you can now
>     provide your own implementation via the MS SQL identity column
>     filter property
>     <http://www.dbunit.org/properties.html#identitycolumnfilter>.
>
>     IDatabaseConnection connection = new DatabaseConnection(jdbcConnection);
>     connection.getConfig().setProperty(
>         "http://www.dbunit.org/properties/mssql/identityColumnFilter",
>         new MyIndentityFilter());
>
>
> MS SQL Server IDENTITY column filter
>
> Property IDhttp://www.dbunit.org/properties/mssql/identityColumnFilter
> Defaultnone
> DescriptionUse to override IDENTITY column detection. The Object must
> implement org.dbunit.dataset.filter.IColumnFilter .
>
>
> On Wed, Feb 23, 2011 at 3:29 AM, nodje <nodje.co
> <http://nodje.co>@gmail.com <http://gmail.com>> wrote:
>
>     André,
>     there's something I don't get with your implementation.
>
>     I still have to affect the property:
>
>     connection.getConfig().setProperty(InsertOperationMSSQL.PROPERTY_IDENTITY_COLUMN_FILTER,
>     IDENTITY_FILTER_EXTENDED);
>
>     so that the IDENTITY_FILTER_EXTENDED is taken into account.
>
>     It doesn't solve the bug, or there's probably an other way to use it.
>
>     Please let me know.
>
>
>     André Abe Vicente wrote:
>     > Nodge I think I had this problem.
>     > I correct the bug by myself implementing my own
>     > InsertIdentityOperation.java (attached)
>     >
>     >
>     > JdbcDatabaseTester databaseTester = new
>     > JdbcDatabaseTester("com.microsoft.sqlserver.jdbc.SQLServerDriver",
>     >
>     >
>      "jdbc:sqlserver://serverName;DatabaseName=databaseName;SelectMethod=cursor",
>     > "login", "password");
>     >
>     >  databaseTester.setSetUpOperation(InsertOperationMSSQL.INSERT);
>     >
>     >
>     > On Tue, Feb 22, 2011 at 8:22 AM, nodje <nodje.co <http://nodje.co>
>     > <http://nodje.co>@gmail.com <http://gmail.com> <http://gmail.com>>
>     wrote:
>     >
>     >     Hi,
>     >
>     >     I'm trying to reenable some old code that use to work.
>     >
>     >    
>     connection.getConfig().setProperty(InsertIdentityOperation.PROPERTY_IDENTITY_COLUMN_FILTER,
>     >     IDENTITY_FILTER_EXTENDED);
>     >
>     >     causes -->Did not find property with name
>     >     'http://www.dbunit.org/properties/mssql/identityColumnFilter'
>     >
>     >     in DatabaseConfig:setProperty:216 -> convertIfNeeded:242 ->
>     >     findByName:411,
>     InsertIdentityOperation.PROPERTY_IDENTITY_COLUMN_FILTER
>     >     is not found in the ALL_PROPERTIES list.
>     >
>     >     I'm using version 2.4.8.
>     >
>     >     I don't understand why this documented property is not found.
>     >     Is there a new way to use it?
>     >
>     >     Cheers
>     >
>     >
>     >    
>     ------------------------------------------------------------------------------
>     >     Index, Search & Analyze Logs and other IT data in Real-Time
>     with Splunk
>     >     Collect, index and harness all the fast moving IT data
>     generated by your
>     >     applications, servers and devices whether physical, virtual or in
>     >     the cloud.
>     >     Deliver compliance at lower cost and gain new business insights.
>     >     Free Software Download: http://p.sf.net/sfu/splunk-dev2dev
>     >     _______________________________________________
>     >     dbunit-user mailing list
>     >     [hidden email]
>     <mailto:[hidden email]>
>     >     <mailto:[hidden email]
>     <mailto:[hidden email]>>
>     >     https://lists.sourceforge.net/lists/listinfo/dbunit-user
>     >
>     >
>
>

------------------------------------------------------------------------------
Free Software Download: Index, Search & Analyze Logs and other IT data in
Real-Time with Splunk. Collect, index and harness all the fast moving IT data
generated by your applications, servers and devices whether physical, virtual
or in the cloud. Deliver compliance at lower cost and gain new business
insights. http://p.sf.net/sfu/splunk-dev2dev 
_______________________________________________
dbunit-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/dbunit-user