hi javier

On 11/4/05, Javier Bermejo <[EMAIL PROTECTED]> wrote:
>  Hi Stefan,
>
>  Currently I can say that simpledbpersistence is much faster than
> orm-persistence module. I'm having some troubles with referencing nodes (it
> seems it doesn't work fine, but I need to realize more tests to check it
> correctly).

do those problems occur with the SimpleDbPersistenceManager?
i'd be very surprised...

>
>  I hope in a few days or one week to post here some performance results
> about times for creating nodes, sharing them (using references), versioning
> and so on.

that would be very appreciated, thanks.

> In a short future we will need to implement a cache system over
> simpledb and times will change (does anyone try to implement it?).

chaching ItemState objects retrieved from the PersistenceManager is already
handled by the SharedItemStateManager using a ItemStateReferenceCache.

caching in the PM is IMO unnecessary and even counterproductive as it
consumes memory that could be more efficiently used by SharedItemStateManager.

>
>  I attach you the postgresql.ddl, but I'm not an expert on it, so, somebody
> would review it. The main change is to change the BLOB data type to BYTEA
> (http://www.postgresql.org/docs/7.2/interactive/datatype-binary.html)

thanks a lot! i'll commit it asap.

cheers
stefan

>
>  Best regards
>    Javier
>
>
>  Stefan Guggisberg wrote:
>  hi javier,
>
> On 11/3/05, Javier Bermejo <[EMAIL PROTECTED]> wrote:
>
>
>  Hello,
>
> Some days ago I was testing performance using orm-persistence with
> hibernate 2 and PostgreSQL. Today I have tested SimpleDBPersistence
> using a postgreSQL database and I have detected a bug in the class:
>
> Using JDBC with PostgreSQL doesn't found any table when checking the
> schema because it needs the tableNamePattern in lowercase (not
> uppercase), the effect is that it tries to create every time you start
> the repository the tables and get a Exception. So the solution I propose
> is to search the tableNamePattern using lower and uppercase in the
> checkSchema method:
>
>  protected void checkSchema() throws Exception {
>  String tableName = schemaObjectPrefix + "NODE";
>  ResultSet rs1 = con.getMetaData().getTables(null, null,
>  (tableName).toLowerCase(), null);
>  ResultSet rs2 = con.getMetaData().getTables(null, null,
>  tableName, null);
>  boolean schemaExists;
>  try {
>  schemaExists = rs1.next() || rs2.next();
>  } finally {
>  rs1.close();
>  rs2.close();
>  }
>
> I attach the diff from latest version in svn.
>
>  thanks! i will have a look at it asap.
>
> btw: i'd be very interested in the results of your performance tests.
> could you please share them with us?
>
> btw2: it would be cool if you could contribute a postgres.ddl file
> that works with SimpleDbPersistenceManager (see o.a.j.c.state.db.mysql.ddl
> for an an example for mysql). i 'd more than happy to commit it :)
>
> cheers
> stefan
>
>
>
>  Best regards
>  Javier Bermejo
>
>
>
> Index:
> src/main/java/org/apache/jackrabbit/core/state/db/SimpleDbPersistenceManager.java
> ===================================================================
> ---
> src/main/java/org/apache/jackrabbit/core/state/db/SimpleDbPersistenceManager.java
> (revisión: 330576)
> +++
> src/main/java/org/apache/jackrabbit/core/state/db/SimpleDbPersistenceManager.java
> (copia de trabajo)
> @@ -924,13 +924,17 @@
>  * @throws Exception if an error occurs
>  */
>  protected void checkSchema() throws Exception {
> - ResultSet rs = con.getMetaData().getTables(null, null,
> - schemaObjectPrefix + "NODE", null);
> + String tableName = schemaObjectPrefix + "NODE";
> + ResultSet rs1 = con.getMetaData().getTables(null, null,
> + (tableName).toLowerCase(), null);
> + ResultSet rs2 = con.getMetaData().getTables(null, null,
> + tableName, null);
>  boolean schemaExists;
>  try {
> - schemaExists = rs.next();
> + schemaExists = rs1.next() || rs2.next();
>  } finally {
> - rs.close();
> + rs1.close();
> + rs2.close();
>  }
>
>  if (!schemaExists) {
>
>
>
>
>
>
>
>
> create table ${schemaObjectPrefix}NODE (NODE_ID char(36) not null, NODE_DATA
> BYTEA not null)
> create unique index ${schemaObjectPrefix}NODE_IDX on
> ${schemaObjectPrefix}NODE (NODE_ID)
> create table ${schemaObjectPrefix}PROP (PROP_ID varchar(255) not null,
> PROP_DATA BYTEA not null)
> create unique index ${schemaObjectPrefix}PROP_IDX on
> ${schemaObjectPrefix}PROP (PROP_ID)
> create table ${schemaObjectPrefix}REFS (NODE_ID char(36) not null, REFS_DATA
> BYTEA not null)
> create unique index ${schemaObjectPrefix}REFS_IDX on
> ${schemaObjectPrefix}REFS (NODE_ID)
> create table ${schemaObjectPrefix}BINVAL (BINVAL_ID varchar(255) not null,
> BINVAL_DATA BYTEA not null)
> create unique index ${schemaObjectPrefix}BINVAL_IDX on
> ${schemaObjectPrefix}BINVAL (BINVAL_ID)
>
>
>

Reply via email to