Thanks. Very important tip. ( I'm sure it's in the manual. )

However, I still have the same problem which I tried to solve this way:

I run a jboss client application which reads some Cloudscape tables and
then writes a record to another table.
The reading works okay.
The fact that running the same program twice gives an error that the
primary key isn't unique indicates that writing the record also works
somehow. But whenever I access the database directly ( SELECT * FROM ... )
the record isn't found. Also after shutting down jBoss.

After restarting jBoss the same sequence of events takes place. Somehow the
record is cached by jBoss but never written to the database.


This is the relevant stuff from my jboss.jcml:

  <!-- JNDI -->
  <mbean code="org.jboss.naming.NamingService"
name="DefaultDomain:service=Naming">
    <attribute name="Port">1100</attribute>
  </mbean>
  <mbean code="org.jboss.naming.JNDIView"
name="DefaultDomain:service=JNDIView" />


  <!-- JDBC -->
  <mbean code="org.jboss.jdbc.JdbcProvider"
name="DefaultDomain:service=JdbcProvider">
     <attribute
name="Drivers">COM.cloudscape.core.RmiJdbcDriver</attribute>
  </mbean>


  <mbean code="org.jboss.jdbc.XADataSourceLoader"
name="DefaultDomain:service=XADataSource,name=DefaultDS">
    <attribute name="PoolName">DefaultDS</attribute>
    <attribute
name="DataSourceClass">org.opentools.minerva.jdbc.xa.wrapper.XADataSourceIm
pl</attribute>
    <attribute name="Properties"></attribute>
    <attribute
name="URL">jdbc:rmi://localhost:1099/jdbc:cloudscape:CloudscapeDB;create=tr
ue</attribute>
    <attribute name="GCMinIdleTime">1200000</attribute>
    <attribute name="JDBCUser">sa</attribute>
    <attribute name="MaxSize">10</attribute>
    <attribute name="Password" />
    <attribute name="GCEnabled">false</attribute>
    <attribute name="InvalidateOnError">false</attribute>
    <attribute name="TimestampUsed">false</attribute>
    <attribute name="Blocking">true</attribute>
    <attribute name="GCInterval">120000</attribute>
    <attribute name="IdleTimeout">1800000</attribute>
    <attribute name="IdleTimeoutEnabled">false</attribute>
    <attribute name="LoggingEnabled">false</attribute>
    <attribute name="MaxIdleTimeoutPercent">1.0</attribute>
    <attribute name="MinSize">0</attribute>
  </mbean>


  <mbean code="org.jboss.jdbc.XADataSourceLoader"
name="DefaultDomain:service=XADataSource,name=Cloudscape">
    <attribute name="PoolName">Cloudscape</attribute>
    <attribute
name="DataSourceClass">org.opentools.minerva.jdbc.xa.wrapper.XADataSourceIm
pl</attribute>
    <attribute name="Properties"></attribute>
    <attribute
name="URL">jdbc:rmi://localhost:1099/jdbc:cloudscape:CloudscapeDB;create=tr
ue</attribute>
    <attribute name="GCMinIdleTime">1200000</attribute>
    <attribute name="JDBCUser" />
    <attribute name="MaxSize">10</attribute>
    <attribute name="Password" />
    <attribute name="GCEnabled">false</attribute>
    <attribute name="InvalidateOnError">false</attribute>
    <attribute name="TimestampUsed">false</attribute>
    <attribute name="Blocking">true</attribute>
    <attribute name="GCInterval">120000</attribute>
    <attribute name="IdleTimeout">1800000</attribute>
    <attribute name="IdleTimeoutEnabled">false</attribute>
    <attribute name="LoggingEnabled">false</attribute>
    <attribute name="MaxIdleTimeoutPercent">1.0</attribute>
    <attribute name="MinSize">0</attribute>
  </mbean>


And here my jboss.xml:

<jboss>
    <resource-manager>
        <res-name>jdbc/ConferenceDB</res-name>
        <res-jndi-name>java:/Cloudscape</res-jndi-name>
    </resource-manager>
    <container-configurations>
        <container-configuration>
            <container-name>Standard BMP EntityBean</container-name>
            <commit-option>B</commit-option>
        </container-configuration>
    </container-configurations>
</jboss


This is the way I use the connection:

  private String dbName = "java:comp/env/jdbc/ConferenceDB"; // tried also
"java:/Cloudscape"

  public void setEntityContext(EntityContext context) {
    m_context = context;

    try {
      InitialContext initial = new InitialContext();
      m_ds = (DataSource) initial.lookup( dbName );
    } catch( NamingException xn ) {
      m_ds = null;
    }
  }

  private void makeConnection() throws SQLException {
    System.out.println( "ConfB.makeConnection() - enter, m_con=" + m_con );

    m_con = m_ds.getConnection();

    System.out.println( "ConfB.makeConnection() - leave, m_con=" + m_con );
  }


  public String ejbCreate( ConferenceData cd ) throws CreateException {

    System.out.println( "ConfB.ejbCreate( CD ) - enter" );
    Timestamp t_start = new Timestamp( cd.startTime.getTime() );
    try {
      makeConnection();
      insertRow(  cd.topic, cd.id, t_start, cd.duration, ... ) ;

    } catch( Exception x ) {
      throw new EJBException( "ConfB.ejbCreate(CD): " + x );
    }
    finally {
      closeConnection();
    }

    id = cd.id; // pk
    topic = cd.topic;
    ...
    return id;
  }

  public void ejbPostCreate( ConferenceData cd ){
    System.out.println( "ConfB.ejbPostCreate( CD ) - enter" );
  }

  private void insertRow( String topic, String id,
                          Timestamp start, short duration, ...  )
    throws SQLException {

    System.out.println( "ConfB.insertRow() - enter" );

    PreparedStatement pstmt = null;
    String insertStatement =
      "INSERT INTO conference( topic, id, startTimeS, duration, " +
      "moderator, modPasswd, modGroupPasswd, generalPasswd, " +
      "hasWhiteboard, hasSlideScreen, hasTextChat, hasVoiceChat, " +
      "status, type, creatorID, createTime, billingID ) " +
      "VALUES ( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ? )";

    try {
      pstmt = m_con.prepareStatement( insertStatement );

      pstmt.setString( 1, topic );
      pstmt.setString( 2, id );

        ....

      pstmt.executeUpdate();
    } catch( SQLException xs ){
      throw new SQLException( "ConfB.insertRow(): " + xs );
    }
    finally {
      if ( pstmt != null ) {
        try {
          pstmt.close();
        } catch( Exception x ) { pstmt = null; }
      }
    }
  }





I'm sure it's a stupid mistake somewhere, but any hint would be
appreciated.

Thanks
Ralph


----- Original Message -----
From: Wei-ju Wu <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, July 16, 2001 12:28 PM
Subject: Re: [JBoss-user] cloudscape only


> Are you sure, you removed *every* reference to
> Hypersonic ? Note that, if you run jboss once there
> is a jboss-auto.jcml which also contains references
> to the hypersql database.
>
> Be sure that jboss-auto.jcml only contains
>
> <?xml version="1.0" encoding="UTF-8"?>
> <server>
> </server>
>
> If you have a version with an embedded JSP Engine
> then check if you modified the configuration files in
> the correct configuration directory, there are two in
> this case (one is "default" the other one is "tomcat" or
> "jetty")
>
> Hope that helps,
>
> Wei-ju
>
>
> ----- Original Message -----
> From: "ralph" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, July 16, 2001 4:47 AM
> Subject: [JBoss-user] cloudscape only
>
>
> > I want to remove all databases from jboss and use only Cloudscape, but
I
> > didn't manage yet. I removed all references to Hypersonic and InstantDB
> > from jboss.jcml but still the server.log and messages to standard
output
> > say that Hypersonic and InstantDB servers are being started.
> > Also the startup process hangs after the messages
> > [Hypersonic] Server 1.4 is running
> > [Hypersonic] Press [Ctrl]+[C] to abort.
> >
> > What is the problem? What causes jboss to start Hypersonic and
InstantDB
> > even after removing the entries from jboss.jcml ?
> >
> > Thanks
> > Ralph
> >
> >
> > _______________________________________________
> > JBoss-user mailing list
> > [EMAIL PROTECTED]
> > http://lists.sourceforge.net/lists/listinfo/jboss-user
>
>
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> http://lists.sourceforge.net/lists/listinfo/jboss-user


_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to