Bug 24491 - PATCH: Fixes problem in Oracle with properties longer that 4000 chars.
Summary: PATCH: Fixes problem in Oracle with properties longer that 4000 chars.
Status: NEW
Alias: None
Product: Slide
Classification: Unclassified
Component: Stores (show other bugs)
Version: Nightly
Hardware: Other other
: P3 major with 1 vote (vote)
Target Milestone: ---
Assignee: Slide Developer List
Depends on:
Blocks: 31521
  Show dependency tree
Reported: 2003-11-07 12:32 UTC by Piotr Walendziak
Modified: 2004-11-16 19:05 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description Piotr Walendziak 2003-11-07 12:32:31 UTC

For Oracle varchar2 can have maximum 4000 chars. So after 80 PUT commands slide 
crashes on that document because 'version-set' property length of history object 
(for example /history/1) is exceeded.

So I would like propose new schema for Oracle (what is really important is 
property value stored as clob) and patch to JDBCDescriptorStore that works with 
this schema:


--Slide schema for user_5
--Modified for named primary keys 11.09.2003.
drop table objects;
drop table children;
drop table links;
drop table permissions;
drop table locks;
drop table revisions;
drop table workingrevision;
drop table latestrevisions;
drop table branches;
drop table revision;
drop table label;
drop table property;
drop table revisioncontent;

create table objects(uri varchar(3200), classname varchar(4000));

create table children(uri varchar(4000), childuri varchar(4000));

create table links(link varchar(4000), linkto varchar(4000));

create table permissions(object varchar(4000), revisionnumber varchar(20), 
  subject varchar(1500), action varchar(400), inheritable int, negative int);

create table locks(id varchar(4000), object varchar(4000), 
  subject varchar(4000), type varchar(4000), 
  expirationdate varchar(15), inheritable int, xexclusive int);

create table revisions(uri varchar(3200), 
  isversioned int, initialrevision varchar(10));

create table workingrevision(uri varchar(4000), 
  baserevision varchar(20), xnumber varchar(20));

create table latestrevisions(uri varchar(4000), 
  branchname varchar(4000), xnumber varchar(20));

create table branches(uri varchar(4000), xnumber varchar(20), 
  childnumber varchar(20));

create table revision(uri varchar(4000), xnumber varchar(20), 
  branchname varchar(4000));

create table label(uri varchar(4000), xnumber varchar(20), 
  label varchar(4000));

create table property(uri varchar(4000), xnumber varchar(20), 
  name varchar(4000), value clob, namespace varchar(4000), 
  type varchar(100), protected int);

create table revisioncontent(uri varchar(4000), xnumber varchar(20), 
  content blob);

alter table objects add constraint pk_objects primary key (uri);
alter table revisions add constraint pk_revisions primary key (uri);
create index idx_rc_uri_xnumber on revisioncontent (uri, xnumber);
create index idx_chld_uri on children (uri);
create index idx_lnks_linkto on links (linkto);
create index idx_lnks_link on links (link);
create index idx_perm_osar on permissions (object, subject, action, 
create index idx_perm_obj on permissions (object);
create index idx_lcks_id on locks (id);
create index idx_lcks_obj on locks (object);
create index idx_wrkrev_uri on workingrevision (uri);
create index idx_ltstrev_uri on latestrevisions (uri);
create index idx_rev_uri on revision (uri);
create index idx_rev_uri_xnumber on revision (uri, xnumber);
create index idx_brnch_uri_xnumber on branches (uri, xnumber);
create index idx_lbl_uri_xnumber on label (uri, xnumber);
create index idx_prop_uri_xnumber on property (uri, xnumber);


> 		Clob pValueClob = res.getClob(PROPERTY_VALUE);
> 		String propertyValue = null;
> 		if(pValueClob != null) {
> 			long pValueClobLength = pValueClob.length();
> 			char pValueChars[] = new char[(int)pValueClobLength];
> 			Reader pValueClobReader = pValueClob.getCharacterStream();
> 			pValueClobReader.read(pValueChars);
> 			pValueClobReader.close();
> 			propertyValue = new String(pValueChars);
> 		}
<                                      res.getString(PROPERTY_VALUE), 
>                                      propertyValue,
<         } finally {
>         } catch (IOException e) {
>             getLogger().log(e,LOG_CHANNEL,Logger.ERROR);
>             throw new ServiceAccessException(this, e);
>         }
> 	finally {
<                 statement.setString(4, property.getValue().toString());
> 		char pValueChars[] = property.getValue().toString().toCharArray();
> 		Reader pValueReader = new CharArrayReader(pValueChars);
>                 statement.setCharacterStream(4, pValueReader, pValueChars.
> 		pValueReader.close();
>             throw new ServiceAccessException(this, e);
>         } catch (IOException e) {
>             getLogger().log(e,LOG_CHANNEL,Logger.ERROR);