Hibernate - 无法提交 Hibernate 事务;嵌套异常是 org.hibernate.TransactionException

时间:2021-01-26 01:21:34

标签: spring hibernate spring-mvc jpa spring-data-jpa

我需要从两个不同的数据库中获取数据。为此,我创建了两个会话、两个事务管理器。我正在从第一个事务方法调用第二个事务方法。它在一段时间内工作正常,但之后由于某种原因,hibernate 抛出以下异常。谁能帮我?提前致谢。

#include<stdlib.h>
/*               
{
     "name":"name1",
     "city":"city1",
     "phone":"125698745663" 
}
/* Boxes of my list */
typedef_struct box
{
   char* current_string;
   box* next;
}box;   
/* Define the structure of the list that I'll return after*/
typedef_struct list
{
   box* beginning;
}list;
/*The function that return the list of the objects that existed in our files*/
**char lire (FILE* my_file) //It is possibly to put the path of the file as an argument
{
      char* nameFile;
      printf("enter the name of the file");
      scanf("%s", &nameFile);
      my_file = fopen( "nameFile","r");
      if (my_file != NULL)
      {
        box* temp;
        int i=0;
        list* my_list;
        int first_time = 0;
        /* browse file elements */
        do
        {
            char c = fgetc(my_file); 
           /* I put the following condition to get the value without its key*/
            if(c == ":")  
            {
                while(c!=",")
                {
                 temp->current_string[i] = c; 
                 i++;
                 // printf("%c",c);  
                 c=fgetc(my_file);
                }        
             }
            /*I put this condition to pass to the following element of the list and fill it*/
            if(c == "}")
            {
                first_time++; 
                /*This condition is for getting the begining of the list because it is what distinguishes the list*/
                if(first_time==1) 
                      my_list->beginning->current_string = temp->current_string;
                temp = temp->next;
            } 
         } while (c != EOF); 
        fclose(my_file);
      }
return my_list;
}```


 

0 个答案:

没有答案
相关问题