我想知道corePoolSize和throttle-limit之间的区别,因为Spring Batch属性定义了多线程配置.
由于这篇文章"Spring ThreadPoolTaskExecutor中corePoolSize和maxPoolSize有什么区别",我对corePoolSize和maxPoolSize有所区别.
但是我的问题涉及corePoolSize vs throttle-limit ...我发现定义CorePoolSize = Throttle-limit更好,但我想知道......如果我定义的例子:CorePoolSize = 100和Throttle-limit = 200 .. . 怎么了 ?是一个200大小的线程池,将创建或100?
谢谢你的任何澄清......
我在JPA测试类中遇到字符编码问题。
\n\n在我的h2 内存数据库中,我有这个插入查询:
\n\nINSERT INTO MYTABLE (ID,FIELD1,FIELD2) VALUES (100,\'ABC\',\'R\xc3\xa9clamation\');\nRun Code Online (Sandbox Code Playgroud)\n\n(请注意“R\xc3\xa9clamation”中的“\xc3\xa9”字符)
\n\n在我的 JUnit 测试中,我尝试断言 FIELD2 列的值等于“R\xc3\xa9clamation”(如您所见)
\n\n但它失败并出现以下错误:
\n\n\n\n\norg.junit.ComparisonFailure:预期:R[\xc3\xa9]clamation,但\n是:R[\xef\xbf\xbd]clamation
\n
我想知道是否有一种方法可以在 persistence.xml 文件中指定字符编码(也许?或其他地方)
\n\n这是我的 persistence.xml 测试文件:
\n\n<?xml version="1.0" encoding="UTF-8"?>\n<persistence\n version="2.1"\n xmlns="http://xmlns.jcp.org/xml/ns/persistence"\n xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"\n xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence\n http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">\n\n <persistence-unit name="myTestPU">\n <provider>org.hibernate.jpa.HibernatePersistenceProvider</provider>\n <class>com.myproject.myclass1</class>\n <class>com.myproject.myclass2</class>\n <properties>\n <property\n name="javax.persistence.schema-generation.database.action"\n value="none" />\n <property\n name="javax.persistence.sharedCache.mode"\n value="ENABLE_SELECTIVE" />\n <property\n name="javax.persistence.jdbc.url"\n value="jdbc:h2:mem:test;INIT=RUNSCRIPT FROM \'classpath:ddl/schema.sql\'\\;RUNSCRIPT FROM \'classpath:ddl/data.sql\'" />\n <property\n name="javax.persistence.jdbc.driver"\n value="org.h2.Driver" />\n <property\n name="hibernate.dialect"\n value="org.hibernate.dialect.H2Dialect" />\n <property\n name="hibernate.show_sql"\n …Run Code Online (Sandbox Code Playgroud) 我有一个菜单,我以编程方式用模型填充该菜单。但我希望当它的项目太多而无法在页面中显示时它变得可滚动。
这是我的菜单:
<p:menu overlay="true" trigger="imgNotif" my="left top"
at="bottom left" model="#{notifController.model}" />
Run Code Online (Sandbox Code Playgroud)
有没有办法让它可滚动(以编程方式或使用其样式/属性)?
谢谢
我正在使用spring数据(jpaRepository)+ Oracle 11g数据库.
这是我的JUnit测试的代码:
@Test
public void testAjoutUtilisateur() {
Utilisateur utilisateur = new Utilisateur();
(...)
utilisateur=repository.save(utilisateur);
Utilisateur dbutilisateur = repository.findOne(utilisateur.getIdutilisateur());
assertNotNull(dbutilisateur);
Run Code Online (Sandbox Code Playgroud)
当我调试时,我发现repository.save方法返回的"utilisateur"对象具有类似" 2100 " 的id,而数据库中对应的插入行具有类似" 43 " 的id .
我有一个带有序列和触发器的Oracle数据库,为我的"Utilisateur"表的id提供自动递增的属性.
这是我的Utilisateur实体中的id定义:
@Entity
@NamedQuery(name="Utilisateur.findAll", query="SELECT u FROM Utilisateur u")
@SequenceGenerator(sequenceName="ID_UTILISATEUR_SEQ", name="ID_UTILISATEUR_SEQ")
public class Utilisateur implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="ID_UTILISATEUR_SEQ")
private Long idutilisateur;
Run Code Online (Sandbox Code Playgroud)
问题出在哪儿?它在save方法中吗?
谢谢.
编辑:
我发现@jhadesdev的解决方案已经解决了问题,并且当触发器处于活动状态时插入了我正在讨论的数据行.
最后,我必须提到,默认情况下,JUnit测试似乎不会在数据库中插入数据(它会插入然后回滚).为了使此行为无效,我们必须@TransactionConfiguration(defaultRollback=false)在测试类中指定注释.
例如(在我的情况下):
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration(locations = { "classpath:context/dao-context.xml" })
@TransactionConfiguration(defaultRollback=false)
@Transactional
public class UtilisateurRepositoryTest …Run Code Online (Sandbox Code Playgroud) 我想改变它的形状p:rating..并显示圆形或正方形或其他任何东西而不是星星.可能吗.也许是通过CSS?
primefaces ×2
spring ×2
css ×1
eclipse ×1
h2 ×1
java ×1
jpa ×1
jsr ×1
menu ×1
oracle11g ×1
rating ×1
scroll ×1
scrollable ×1
spring-batch ×1