Skip to content

Tag: runnable

Having Listener in new Thread

I’m trying to place my KeyListener in a new Thread called Keys in my project because my main thread is already in a loop. So I want this method to return a boolean if the key is pressed or not. I’m pretty new to Java so sorry if that is just a dumb mistake. Thread: I would appreciate an example.

Calling @Transactional methods from another thread (Runnable)

Is there any simple solution to save data into database using JPA in a new thread? My Spring based web application allows user to manage scheduled tasks. On runtime he can create and start new instances of predefined tasks. I am using spring’s TaskScheduler and everything works well. But I need to save boolean result of every fired task into