Akmal Sarhan wrote:

>> What I do to use the latest torque code with turbine is create two
>> connections to the database. One through Turbine and then a separate
>> one through the latest Torque code. This means that I avoid conflict
>> between the old and new libraries.
>
>
> I am trying to upgrade to the latest torque(I am using
> turbine-2.2-b2-dev.jar) but when I tried to use torque-3.0-b2.jar or
> later, it just did not work.
>
> If you could elaborate a bit about how you manage to use the latest
> version.

Hi Akmal,

Okay, so this is probably not an efficient or approved way to combine
the new torque with turbine, and it does not provide new torque
functionality to turbine components like the fulcrum security classes.

Basically it is a hack whereby I place some code like this:

public class Index extends SecureScreen
{
public static boolean o_init = false;

public static void init()
{
if(o_init == false)
{

String x_torque_props =
TurbineServlet.getRealPath("/WEB-INF/conf/Torque.properties");
System.out.println("x_torque_props: "+ x_torque_props);


try{
System.out.println("trying to init Torque ...");
Torque.init(x_torque_props);
System.out.println("Torque Initialized");
}catch(Exception e){e.printStackTrace();}
o_init = true;
}
}

into a turbine class. Then I make sure that this init function has been
called by other methods in other turbine classes that want to access the
database through the new torque.

Basically I am having turbine use its existing database access setup for
its existing systems, but in the classes that I implement myself I am
creating a separate database connection through the new Torque classes -
which operates completely separately - i.e. a separate configuration
file etc.

Hope that helps.

If anyone has any comments on why this is not a good approach I would be
very interested to hear them. It seems to have worked so far.

CHEERS> SAM






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

Reply via email to