I still cannot get the contentstore to work - if I use the
descriptoresstore with the file contentstore it works fine. I have been
doing some debugging:

>From j2eeContentStore2.java - function setVersionID:
...
Connection connection = getCurrentConnection();
Statement insStatement = connection.createStatement();
StringBuffer theSQL = new StringBuffer("SELECT 1 FROM VERSION WHERE
URI_ID =");
theSQL.append(uri_id);
ResultSet res = insStatement.executeQuery(theSQL.toString());
...

At the execute query is fires a select statement for a URI_ID that does
not exist! It never goes past the executeQuery - it does not even throw
an exception?? This happens when I try to upload a file to the server -
making a collection is no problem!

I have tried all kinds of debug parameters on the server and the webapp
but I cannot get any errors from those. All I can do after this is
restarting the server!

I am using jsql 2.27 and sun jdk131 on windows! Any idea?

/Jacob

-----Original Message-----
From: Kumar, Ashok [mailto:[EMAIL PROTECTED]] 
Sent: 22. juli 2002 23:05
To: [EMAIL PROTECTED]
Subject: Slide 2 with TC417beta and J2EE(new DB Schema) How To


Hi All and Jacob

This is in regard to the numerous discussions on J2EE with TC417. Now we
have got  the latest SLIDE 2 from cvs working with Tomcat 417 beta
version. The DB Pool deployment which we have done, uses Tyrex 1.0 and
not Commons-dbcp-pools. So the explanation given below is based on the
Tyrex based approach. 
NOTE: I have the implementation based on the new J2EE database schema
proposed by me to the list. But this should work also for the J2EE store
based on the default schema also. Also Slide is deployed as a webapp
under tomcat.

Steps for Tyrex configuration
-----------------------------
Step1:
 Get the Tyrex1.0 version for http://tyrex.exolab.org/
The following jars are needed in addition to Tyrex namely  
tyrex-1.0.jar 
ots-jts_1.0.jar 
jta_1.0.1.jar 
xerces-J_1.4.0.jar
Castore .92 or above 
Log4j 
The above details are present in
http://jakarta.apache.org/tomcat/tomcat-4.1-doc/jndi-datasource-examples
-howto.html for the tyrex based implementtion.

Step2:
The real database definition has now been moved out of the server.xml
which was the case with the TC40 version and old tyrex. This entries are
now in a seperate xml file and this has to be deployed in the
web-inf/classes of the web app concerned. In our case it is the Slide
web-inf

<domain>
<name>mytyrex_domain</name>
  <!-- Limit to 50 concurrent transactions -->
  <maximum>50</maximum>
  <!-- Default transaction timeout: 2 minutes -->
  <timeout>120</timeout>
  <resources>
    <!-- Specification for data source myDb -->
    <dataSource>
      <name>mtx_db_tx</name>
      <jar>http://localhost/path/JSQLConnect.jar</jar>
      <class>com.jnetdirect.jsql.JSQLXADataSource</class>
      <config>
        <!-- Configuration for XADataSource -->
        <user>myuser</user>
        <password>mypwd</password>
        <serverName>localhost</serverName>
        <portNumber>1433</portNumber>
        <database>my_database</database>
        <logfile>/test.log</logfile>
      </config>
      <limits>
        <!-- Start with 5 connections, never go below 5,
             and never go above 50 -->
        <maximum>50</maximum>
        <minimum>5</minimum>
        <initial>5</initial>
        <!-- Discard connections idle for 5 minutes -->
        <maxRetain>300</maxRetain>
        <!-- If maximum reached, block for 10 seconds -->
        <timeout>10</timeout>
      </limits>
    </dataSource>
  </resources>
</domain>

Step3:

The tag <jar> has to be a valid url which tyrex expects. But the DBjar
file need not be present in that location.It can be at its usual place
in tomcat common/lib. Somehow tyrex insists things this way. The
JSQLCOnnect which we used was 2.27 version. The older version has
serious issues on XADatasource implementation. The 2 tags( <name>) will
be reffered to in the tomcat server.xml and also the name of the above
xml

Given below is the entry in the server.xml. 

        <Context path="/slide" docBase="slide" debug="0"
privileged="true">
                <Environment name="tyrexDomainConfig"
type="java.lang.String" value="mytyrexconfig.xml"/>
                <Environment name="tyrexDomainName"
type="java.lang.String" value="mytyrex_domain"/>        
                <Resource name="jdbc/my_db" auth="Container"
type="tyrex.resource.Resource"/>
                <ResourceParams name="jdbc/my_db">
                  <parameter>
                    <name>name</name>
                    <value>mtx_db_tx</value>
                  </parameter>
                </ResourceParams>               
        </Context>
The above entry is specfic to Slide.

Changes required in web.xml of Slide for working with TC417.
------------------------------------------------------------
STEP4: 

The XML dTd definition has to be 2.3 based;
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE web-app
    PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
    "http://java.sun.com/dtd/web-app_2_3.dtd";>    

Step5:
There has been changes in the role based  security configuration for
TC417 Normally Slide will have the roles user,root and guest mentioned
under security-constraint in web.xml. Now for each of this roles we need
the following entries also 
     <security-role>
        <role-name>root</role-name>
     </security-role>   
     <security-role>    
        <role-name>guest</role-name>
     </security-role>   
     <security-role>    
        <role-name>user</role-name>
     </security-role>
This above entries have to be in the web.xml after the login-config
entries (due to dtd restrictions)

With all this steps I have the Slide now working with TC417 + Tyrex.

Jacob as U mentioned in one of the previous mails about some
modifications, which U tried out to my new database schema proposal, if
u can pass on the info I could also try them out. As U might have
experienced , I prefer to stick to the new DB design as it is a nice
performer. 
Hope this helps all.

Ashok










--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to