Giter VIP home page Giter VIP logo

Comments (10)

decebals avatar decebals commented on July 17, 2024

You say that select operation works as expected (you see the sql in log) and the insert operation doesn't work?

from pf4j-spring.

Prashanttorat avatar Prashanttorat commented on July 17, 2024

yes , select is working and insert not working, i have set hibernate show sql flag as true and select statements are getting logged where as insert not , and there is no any exception

from pf4j-spring.

decebals avatar decebals commented on July 17, 2024

It's strange. I don't see how PF4J can lead to a such behavior. You can put PF4J log on debug (or trace) level to have more information but again.

from pf4j-spring.

Prashanttorat avatar Prashanttorat commented on July 17, 2024

i have tried like created data source in plugin and not sharing application of main then it is working

but i wanted to share application context like parent - child , use only one data source which is created by parent application context

let me explain what i am trying to achieve is there will be parent app context which is main will create child context for plugins for the same i have written code like this

AnnotationConfigServletWebServerApplicationContext appContext = (AnnotationConfigServletWebServerApplicationContext) pluginManager.getApplicationContext();

AnnotationConfigApplicationContext applicationContext = new AnnotationConfigApplicationContext();

applicationContext.setClassLoader(getWrapper().getPluginClassLoader());
applicationContext.setParent(appContext);

i have created data source in parent context only and in plugin i am just using parent context has data sourec, in spring jpa config injected data source and created entity manger factory for plugin

one thing here is data source created by root application class loader and child entities and entity manager factory is created bu Plugin class loader - may be this causing something

do you have any thing on this?

from pf4j-spring.

decebals avatar decebals commented on July 17, 2024

Did you tried to search in closed issues, to see if you find a solution?

from pf4j-spring.

Prashanttorat avatar Prashanttorat commented on July 17, 2024

Yes, i have gone through these issue , so i came to know about context sharing and parent child relation context.

Spring beans are also resolved using annotation itself service is created, spring JPA repository object is also created

if i set hbm2ddl.auto propert as create the its also creating table for the same entity which is part of plugin

only on save - there is nothing happen, no log no exception

from pf4j-spring.

decebals avatar decebals commented on July 17, 2024

And #7?

from pf4j-spring.

Prashanttorat avatar Prashanttorat commented on July 17, 2024

i am able to discovered controller and services that is not issue.

issue is in while saving data using hibernate , in my plugin has Spring JPARepositry (org.springframework.data.jpa.repository.JpaRepository) used to deal with db operaition

only thing is data source is created at parent context and same data source using in child context which is plugin

from pf4j-spring.

decebals avatar decebals commented on July 17, 2024

@Prashanttorat
I don't know how can I help you. I don't use Spring in my applications. You have a lot of information about how pf4j and pf4j-spring work. pf4j-spring is a very light project and you can dive in sources very easy.
Maybe other people that use Spring can help you.

from pf4j-spring.

Prashanttorat avatar Prashanttorat commented on July 17, 2024

Hi Decebal Suiu, Thanks for help, issue resolved, i was trying use same entity manger and transaction manager which is created by parent context, which is actually false, Scope is different of parent main context and plugin context

i have just created Entity manager Factory and transaction in plugin context now it is working perfectly as expected

from pf4j-spring.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.