Problems with SAPDB

2001-05-14 Thread Joni Suominen

Hi!
I am in a middle of changing our database from HypersonicSQL to SAPDB.
In theory it should be easy ;) This is how I have proceeded:

1. I created a database-schema for SAPDB (actually I found a one from
this mailing list and copied it). I put that file to
$ORION_DIR/config/database-schemas/. The schema file being used:
?xml version=1.0?
!DOCTYPE database-schema PUBLIC -//Evermind//- Database schema 
http://www.orionserver.com/dtds/database-schemas.dtd;

database-schema name=SapDB not-null=not null null=
primary-key=primary key max-table-name-length=32
  type-mapping type=boolean  name=boolean /
  type-mapping type=java.lang.Booleanname=boolean /
  type-mapping type=byte name=byte /
  type-mapping type=java.lang.Byte   name=byte /
  type-mapping type=char name=char /
  type-mapping type=java.lang.Character  name=char /
  type-mapping type=double   name=double precision
/
  type-mapping type=java.lang.Double name=double precision
/
  type-mapping type=floatname=float /
  type-mapping type=java.lang.Float  name=float /
  type-mapping type=int  name=integer /
  type-mapping type=java.lang.Integername=integer /
  type-mapping type=long name=integer /
  type-mapping type=java.lang.Long   name=integer /
  type-mapping type=shortname=smallint /
  type-mapping type=java.lang.Short  name=smallint /
  type-mapping type=java.lang.String name=varchar(255) /
  type-mapping type=java.math.BigDecimal name=fixed(15,15) /
  type-mapping type=byte[]   name=long byte /
  type-mapping type=java.sql.Datename=date /
  type-mapping type=java.sql.Timename=time /
  type-mapping type=java.sql.Timestamp   name=timestamp /
  type-mapping type=java.util.Date   name=timestamp /
  type-mapping type=java.io.Serializable name=long byte /
  
  disallowed-field name=key /
  disallowed-field name=date /
  disallowed-field name=timestamp /
  disallowed-field name=time /
  disallowed-field name=username /
  disallowed-field name=password /
  disallowed-field name=order /
  disallowed-field name=table /
  disallowed-field name=value /
  disallowed-field name=name /
  disallowed-field name=count /

/database-schema

2. I created a data-source description for SAPDB and pointed my
application to use it. The data-source description being used:
data-sources

 data-source class=com.evermind.sql.ConnectionDataSource
  inactivity-timeout=120
  location=jdbc/DefaultCoreDS
  pooled-location=jdbc/DefaultPooledDS
  name=SAPTest data-source
  schema=./database-schemas/sapdb.xml
  xa-location=jdbc/xa/DefaultXADS
  ejb-location=jdbc/DefaultDS
  url=jdbc:sapdb://localhost/testdb
  connection-driver=com.sap.dbtech.jdbc.DriverSapDB
  username=TEST
  password=TEST
  /

/data-sources

3. I added the SAPDB JDBC driver to $ORION_DIR/lib

4. I restarted Orion


I believe that in an ideal case these would be the required steps when
database is changed. However, I encountered two problems:

1. Table auto-creation was not fully successful. All the other tables
were correctly created but one. SAPDB has a limit for maximum lenght for
table row names but I didn't find any way to specify this in schema
definition. Maximum legth for table names are supported by the attribute
max-table-name-length=32 and it works fine. Do you know if there's a
similar way to restrict the length of a row? (I tried
max-row-name-length but wasn't lucky :)

2. The following exception is thrown:
com.evermind.server.rmi.OrionRemoteException: javax.ejb.EJBException:
Error saving state: Connection was closed
at com.evermind.server.ejb.EJBUtils.getUserException(JAX)
at
UserManager_StatelessSessionBeanWrapper14.getGroupNamesForUser(UserManager_StatelessSessionBeanWrapper14.java:1348)
at
org.shiftctrl.framework.security.authentication.DefaultLoginModule.commit(DefaultLoginModule.java:243)
...

Nested exception is:
javax.ejb.EJBException: Error saving state: Connection was closed
at
SCUser_EntityBeanWrapper5.saveState(SCUser_EntityBeanWrapper5.java:1057)
at
SCUser_EntityBeanWrapper5.getGroupNames(SCUser_EntityBeanWrapper5.java:712)
at
org.shiftctrl.user_management.service.UserManagerEJB.getGroupNamesForUser(UserManagerEJB.java:328)
...

The control goes so that the user is first authenticated using a session
bean + CMP entity bean. Then the user's login metadata (last login, num
of logins et.) is correctly updated using a session bean + CMP entity
bean. After that the intention is to initialize user's session by
calling getGroupNamesForUser() on a session 

Re: Problems with SAPDB (correction)

2001-05-14 Thread Joni Suominen

I meant column names when I wrote row names. As far as I know the row's
usually don't have any names ;) Stupid me...

Anyway, the problems remain...

Joni
[EMAIL PROTECTED]