Proxying the Session: a requirement ?
by Sanne Grinovero
It turns out that using Bridger to restore backwards binary
compatibility will make the Session un-proxable.
Specifically any code attempint to invoke something like:
Session wrapped = (Session) Proxy.newProxyInstance(
Session.class.getClassLoader(),
new Class[] { Session.class }
wrapper
);
will fail at runtime, as the JDK Proxy utility can't deal with bridge methods.
We do proxy the Session in some of our own code - which is of course
something that could be resolved with alternatives - but I wonder if
this approach will break many more frameworks and tools I'm not aware
of.
What do you all think, is this a deal breaker? I'm starting to think
the cure is worse than the disease :/
Thanks,
Sanne
8 years
CI Updates
by Davide D'Alto
I'm going to run some updates on CI this Friday.
Cheers,
Davide
8 years
Travis build being very unstable with ORM
by Guillaume Smet
Hi,
I don't know if it's an issue you had before with our CI but the Travis
builds are very unstable, failing with this message:
:hibernate-core:testPicked up _JAVA_OPTIONS: -Xmx2048m -Xms512m
No output has been received in the last 10m0s, this potentially indicates a
stalled build or something wrong with the build itself.
Just got 3 in a row...
Moreover the only time I got a build to finish, the build was really really
long.
Wondering if it's such an improvement to base the PR testing on Travis for
ORM.
WDYT?
--
Guillaume
8 years
Is unidirectional one-to-one referencing a non-primary key valid
by Gail Badner
Hi,
This is an unusual mapping. My gut feeling is that it is not a valid
mapping, but I don't see anything in the spec that would indicate it is
invalid.
Here is the mapping:
@Entity
public class Product {
@Id
@Column(name = "id")
private int id;
@OneToOne(cascade = CascadeType.ALL)
@JoinColumn(name = "id", referencedColumnName = "productId",
insertable = false, updatable = false)
private ProductInfo productInfo;
}
@Entity
public class ProductInfo{
@Id
private int id;
@Column(name = "productId", unique = true, updatable = false)
private int productId;
}
Hibernate ignores referencedColumnName = "productId" and assumes that
Product and ProductInfo share the same ID value.
When the IDs are not the same, Product#productInfo will be null.
It seem to me that the foreign key column should be
ProductInfo#productId and should reference Product#id, but this
doesn't make sense
for a unidirectional one-to-one owned by Product.
IMO, a bidirectional @OneToOne with ProductInfo owning the association
would make more sense.
A test case can be found at [1]
Is the mapping invalid, or is this a bug in Hibernate?
Thanks,
Gail
[1] https://github.com/gbadner/hibernate-test-case-templates/commit/d806d4ef5...
8 years