Search Mailing List Archives


Limit search to: Subject & Body Subject Author
Sort by: Reverse Sort
Limit to: All This Week Last Week This Month Last Month
Select Date Range     through    

[protege-discussion] Problems with database backend using DB2

Jonathan Carter jonathan.carter at e-asolutions.com
Thu Oct 22 13:43:54 PDT 2009


Thanks Timothy!

This is really helpful - and very powerful. Makes it easy to tweak how  
the tables are created for any database. Very nice
I'll let you know how we get on with the DB2 settings.

Regards

Jonathan
_______________________________________

Jonathan Carter - Head of Technical Architecture
Enterprise Architecture Solutions Ltd
_______________________________________


Proud sponsors of The Essential Project.
The free open-source Enterprise Architecture Management Platform
www.enterprise-architecture.org
_______________________________________

On 22 Oct 2009, at 18:32, Timothy Redmond wrote:

>
> Hi Jonathan -
>
> Sorry for the late response.  This may very well be too late to be  
> useful.
>
> We don't support DB2.  It hasn't been tested the entire time I have  
> been here.  But if you are still trying and have access to a DB2  
> database it is possible to custom configure it.  There are some  
> rarely used protege.properties that you can set.  For example, if  
> your driver name is
>
> 	com.ibm.db2.Driver
>
> (I invented that) then setting the property
>
> Database.typename.frame.name.type.com.ibm.db2.Driver=DB2VARCHAR(128)
>
> will set the type for the first column of the database.  I took the  
> declarations of these property names from RobustConnection.java and  
> included them below.  I think that the important ones are
>
>> Database.typename.frame.name.type -- the type used for frame names
>
>> Database.typename.bit - a boolean type
>
>> Database.typename.short.value.type -- a type for relatively small  
>> object
>
>> Database.typename.longvarchar - a type for bigger objects
>
>> Database.type.varchar.maxsize  -- the line between small and bigger  
>> objects
>
> The frame name type must be case sensitive (or you will have the  
> expected but possibly manageable problems).  The short value type  
> must be able to take a character array of length varchar.maxsize.
>
> The best way to modify the protege properties is with the protege  
> properties tab.  When modifying the file directly, the fact that  
> Protege updates the protege.properties file on exit/save can become  
> annoying.  If you get good settings I can include them in the  
> default Protege distribution.
>
> -Timothy
>
>>    public static final String OLD_PROPERTY_LONGVARCHAR_TYPE_NAME =  
>> "SimpleJdbcDatabaseManager.longvarcharname";
>>    public static final String PROPERTY_LONGVARCHAR_TYPE_NAME =  
>> "Database.typename.longvarchar";
>>    public static final String PROPERTY_FRAME_NAME_TYPE_NAME =  
>> "Database.typename.frame.name.type";
>>    public static final String PROPERTY_SHORT_VALUE_TYPE_NAME =  
>> "Database.typename.short.value.type";
>>    public static final String PROPERTY_VARCHAR_TYPE_SIZE =  
>> "Database.type.varchar.maxsize";
>>    public static final int DEFAULT_MAX_STRING_SIZE = 255;
>>    public static final String PROPERTY_INTEGER_TYPE_NAME =  
>> "Database.typename.integer";
>>    public static final String PROPERTY_SMALL_INTEGER_TYPE_NAME =  
>> "Database.typename.small_integer";
>>    public static final String PROPERTY_BIT_TYPE_NAME =  
>> "Database.typename.bit";
>
> On Oct 16, 2009, at 2:23 AM, Jonathan Carter wrote:
>
>> Further to this problem, here is the exception that is being raised  
>> when Protege attempts to create the database for the project in DB2.
>>
>> My user reports that, "We are using Protege 3.4.1 "DB2 v8.1.0.128",  
>> "s061108", "U810099", and FixPak  "14"
>>
>> The exception follows, and you can see that the length parameters  
>> for the VARCHAR columns are not reported. Now, whether this means  
>> that Protege is not sending them in the CREATE TABLE statement or  
>> that DB2 is not reporting them in the exception, e.g. if the  
>> statement looks like 'frame VARCHAR() NOT NULL' because the call to  
>> DB2 to get the max length isn't returning anything.
>> DB2 is reporting that the parameters for creating the columns are  
>> not valid.
>>
>> WARNING: Failed to create table on database DB2/SUN with command  
>> 'CREATE TABLE essentialbaseline (frame VARCHAR NOT NULL, frame_type  
>> SMALLINT NOT NULL, slot VARCHAR NOT NULL, facet VARCHAR NOT NULL,  
>> is_template SMALLINT NOT NULL, value_index INTEGER NOT NULL,  
>> value_type SMALLINT NOT NULL, short_value VARCHAR, long_value LONG  
>> VARCHAR)' :DB2 SQL error: SQLCODE: -604, SQLSTATE: 42611, SQLERRMC:  
>> FRAME -- DefaultDatabaseFrameDb.createTable()
>> WARNING: Errors at copying knowledgebase jdbc:db2://zddogdb1:50000/ 
>> DBEASD01 -- com.ibm.db2.jcc.b.SqlException: DB2 SQL error: SQLCODE:  
>> -604, SQLSTATE: 42611, SQLERRMC: FRAME
>> at com.ibm.db2.jcc.b.id.e(id.java:1640)
>> at com.ibm.db2.jcc.b.id.b(id.java:1197)
>> at com.ibm.db2.jcc.c.fb.i(fb.java:234)
>> at com.ibm.db2.jcc.c.fb.b(fb.java:50)
>> at com.ibm.db2.jcc.c.s.b(s.java:36)
>> at com.ibm.db2.jcc.c.wb.f(wb.java:141)
>> at com.ibm.db2.jcc.b.id.m(id.java:1194)
>> at com.ibm.db2.jcc.b.id.a(id.java:1922)
>> at com.ibm.db2.jcc.b.id.c(id.java:560)
>> at com.ibm.db2.jcc.b.id.executeUpdate(id.java:545)
>> at  
>> edu 
>> .stanford 
>> .smi 
>> .protege 
>> .storage.database.AbstractDatabaseFrameDb.executeUpdate(Unknown  
>> Source)
>> at  
>> edu 
>> .stanford 
>> .smi 
>> .protege 
>> .storage.database.DefaultDatabaseFrameDb.createTable(Unknown Source)
>> at  
>> edu 
>> .stanford 
>> .smi 
>> .protege 
>> .storage 
>> .database.DefaultDatabaseFrameDb.ensureEmptyTableExists(Unknown  
>> Source)
>> at  
>> edu 
>> .stanford 
>> .smi 
>> .protege 
>> .storage.database.DefaultDatabaseFrameDb.overwriteKB(Unknown Source)
>> at  
>> edu 
>> .stanford 
>> .smi 
>> .protege 
>> .storage 
>> .database.DatabaseKnowledgeBaseFactory.copyKnowledgeBase(Unknown  
>> Source)
>> at  
>> edu 
>> .stanford 
>> .smi 
>> .protege 
>> .storage 
>> .database.DatabaseKnowledgeBaseFactory.copyKnowledgeBase(Unknown  
>> Source)
>> at  
>> edu 
>> .stanford 
>> .smi 
>> .protege 
>> .storage 
>> .database.DatabaseKnowledgeBaseFactory.saveKnowledgeBase(Unknown  
>> Source)
>> at edu.stanford.smi.protege.model.Project.saveDomainKB(Unknown  
>> Source)
>> at edu.stanford.smi.protege.model.Project.save(Unknown Source)
>> at edu.stanford.smi.protege.ui.ProjectManager.save(Unknown Source)
>> at  
>> edu 
>> .stanford.smi.protege.ui.ProjectManager.saveProjectRequest(Unknown  
>> Source)
>> at  
>> edu.stanford.smi.protege.action.SaveProject.actionPerformed(Unknown  
>> Source)
>> at  
>> javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java: 
>> 1849)
>> at javax.swing.AbstractButton 
>> $Handler.actionPerformed(AbstractButton.java:2169)
>> at  
>> javax 
>> .swing 
>> .DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:420)
>> at  
>> javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java: 
>> 258)
>> at  
>> javax 
>> .swing 
>> .plaf 
>> .basic.BasicButtonListener.mouseReleased(BasicButtonListener.java: 
>> 236)
>> at  
>> java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java: 
>> 231)
>> at java.awt.Component.processMouseEvent(Component.java:5517)
>> at javax.swing.JComponent.processMouseEvent(JComponent.java:3135)
>> at java.awt.Component.processEvent(Component.java:5282)
>> at java.awt.Container.processEvent(Container.java:1966)
>> at java.awt.Component.dispatchEventImpl(Component.java:3984)
>> at java.awt.Container.dispatchEventImpl(Container.java:2024)
>> at java.awt.Component.dispatchEvent(Component.java:3819)
>> at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java: 
>> 4212)
>> at java.awt.LightweightDispatcher.processMouseEvent(Container.java: 
>> 3892)
>> at java.awt.LightweightDispatcher.dispatchEvent(Container.java:3822)
>> at java.awt.Container.dispatchEventImpl(Container.java:2010)
>> at java.awt.Window.dispatchEventImpl(Window.java:1791)
>> at java.awt.Component.dispatchEvent(Component.java:3819)
>> at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
>> at  
>> java 
>> .awt 
>> .EventDispatchThread 
>> .pumpOneEventForHierarchy(EventDispatchThread.java:242)
>> at  
>> java 
>> .awt 
>> .EventDispatchThread 
>> .pumpEventsForHierarchy(EventDispatchThread.java:163)
>> at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java: 
>> 157)
>> at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java: 
>> 149)
>> at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
>>
>>
>> Thanks for your help
>>
>> Regards
>>
>> Jonathan
>>
>> _______________________________________
>>
>> Jonathan Carter - Head of Technical Architecture
>> Enterprise Architecture Solutions Ltd
>> _______________________________________
>>
>>
>> Proud sponsors of The Essential Project.
>> The free open-source Enterprise Architecture Management Platform
>> www.enterprise-architecture.org
>> _______________________________________
>>
>> On 16 Oct 2009, at 00:24, Jonathan Carter wrote:
>>
>>> Hi,
>>>
>>> Has anyone managed to use DB2 as the database backend for a  
>>> Protege 3.4 project?
>>> I have a user who's reporting that the CreateTable() process is  
>>> failing because the MaxCharSize parameters are not being created  
>>> for the VARCHAR columns. e.g. Instead of getting a definition like  
>>> " frame VARCHAR(20) NOT NULL" it's "frame VARCHAR NOT NULL".
>>>
>>> I've had a look at the source code for DatabaseFrameDB.java and I  
>>> can see that the table creation process should create the  
>>> parameter - in fact, I can't see how it cannot - at the very least  
>>> it should be writing VARCHAR() NOT NULL.
>>>
>>> Any experience of DB2 or any suggestions would be gratefully  
>>> received
>>>
>>> Thanks
>>>
>>> Regards
>>>
>>> Jonathan
>>> _______________________________________
>>>
>>> Jonathan Carter - Head of Technical Architecture
>>> Enterprise Architecture Solutions Ltd
>>> Web: www.enterprise-architecture.com
>>> _______________________________________
>>>
>>> Proud sponsors of The Essential Project.
>>> The free open-source Enterprise Architecture Management Platform
>>>
>>>
>>> <essentialProjectLogo_200.png>
>>> www.enterprise-architecture.org
>>> _______________________________________
>>>
>>> W O R L D    C L A S S    A R C H I T E C T U R E
>>>
>>> _______________________________________________
>>> protege-discussion mailing list
>>> protege-discussion at lists.stanford.edu
>>> https://mailman.stanford.edu/mailman/listinfo/protege-discussion
>>>
>>> Instructions for unsubscribing: http://protege.stanford.edu/doc/faq.html#01a.03
>>
>> _______________________________________________
>> protege-discussion mailing list
>> protege-discussion at lists.stanford.edu
>> https://mailman.stanford.edu/mailman/listinfo/protege-discussion
>>
>> Instructions for unsubscribing: http://protege.stanford.edu/doc/faq.html#01a.03
>
> _______________________________________________
> protege-discussion mailing list
> protege-discussion at lists.stanford.edu
> https://mailman.stanford.edu/mailman/listinfo/protege-discussion
>
> Instructions for unsubscribing: http://protege.stanford.edu/doc/faq.html#01a.03

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.stanford.edu/pipermail/protege-discussion/attachments/20091022/70f17762/attachment.html>


More information about the protege-discussion mailing list