Hello,

I am trying to use OrientDB in combination with any other relational 
Database. My current Problem is to setup the second DataSource in the 
Spring Context. 

The relational DataSource is declared as followed:

<bean id="relationalDataSource" 
>> class="org.springframework.jdbc.datasource.SingleConnectionDataSource">
>
>       <property name="driverClassName" value="org.h2.Driver" />
>
>       <property name="url" value="jdbc:h2:mem:" />
>
>       <property name="username" value="user" />
>
>       <property name="password" value="" />
>
>       <property name="suppressClose" value="true" />
>
>    </bean>
>
>
Since there is no jdbc Driver for OrientDB (which works with version 1.6.4) 
i am kinda stuck.


   - which <bean ... class=?>
   - which <property name="driverClassName" value=?>
   - <property name="url" value="i would have passed the url directly to 
   the local:store>

 

 I have tried to read the project "ops4j" from Harald Wellmann. Sadly im 
not that experienced to know exatly what to do. I saw that he declared some 
Beans (see attachment) which being used via @Autowired. 

Env:

OrientDB 1.6.4


regards
Nhat

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.
/*
 * Copyright 2013 Harald Wellmann
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
 * implied.
 *
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package org.ops4j.orient.spring.tx.document;

import org.ops4j.orient.spring.tx.OrientDocumentDatabaseFactory;
import org.ops4j.orient.spring.tx.OrientTransactionManager;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.transaction.annotation.EnableTransactionManagement;


/**
 * @author Harald Wellmann
 *
 */
@Configuration
@EnableTransactionManagement
public class DocumentSpringTestConfig {
    
    @Bean
    public OrientTransactionManager transactionManager() {
        OrientTransactionManager bean = new OrientTransactionManager();
        bean.setDatabaseManager(databaseFactory());
        return bean;        
    }
    
    @Bean
    public OrientDocumentDatabaseFactory databaseFactory() {
        OrientDocumentDatabaseFactory manager = new OrientDocumentDatabaseFactory();
        //manager.setUrl("local:target/test");
        manager.setUrl("memory:test");
        manager.setUsername("admin");
        manager.setPassword("admin");
        return manager;
    }
    
    
    @Bean
    public TransactionalDocumentService transactionalService() {
        return new TransactionalDocumentService();
    }
}

Reply via email to