मेरे पास एक सार वर्ग और दो उप वर्ग हैं जो इसे बढ़ाते हैं। मुझे लगता है मैं निम्न विधियोंवसंत @ ट्रांसेक्शन एनोटेशन
public void importDataToDB(){
//all the good stuff goes in here
}
@Transactional
public void executeInsertUpdateQuery(){
//all the good stuff goes in here
}
मेरे जावा कोड
ImportConfigFiles importConfigFiles = (ImportConfigFiles)context.getBean("importConfigFile");
importConfigFiles.setFileLocation(destPath);
importConfigFiles.importDataToDB();
यह काम नहीं करता है मेरी अमूर्त वर्ग में वसंत कॉन्फ़िग फ़ाइल
<bean id="importConfigFile" class="xxx.ImportConfigFiles" parent="parentImportFile"></bean>
<bean id="importFile" class="xxx.ImportUMTSKPIFiles" parent="parentImportFile"></bean>
<bean id="parentImportFile" name="parentImportFile" class="xxx.ImportUMTSFiles" abstract="true"></bean>
<tx:annotation-driven transaction-manager="transactionManager" />
में निम्नलिखित है। executeInsertUpdateQuery() केवल एक देशी एसक्यूएल क्वेरी निष्पादित करता है। अगर मैं imortDataToDB पर @Transactional डालता हूं() यह काम करता है लेकिन फिर यह उस विधि के अंदर से मेरा लेनदेन बड़ा बनाता है, मैं फ़ाइल में सभी पंक्तियों के माध्यम से लूप करता हूं और डीबी में रिकॉर्ड डालता हूं।
त्वरित प्रतिक्रिया के लिए धन्यवाद। – user373201